[PATCH] do not invoke sub-make unless the 'cd directory' succeeds

Mark D. Baushke mdb at juniper.net
Mon Nov 12 03:31:17 EST 2001


If for some reason (directory missing or permissions bad), it is
not possible to cd into either the scards or openbsd-compat direcotries, the
make will enter an infinite loop. Correct this by changing the make idiom

	(cd directory; $(MAKE))

to the idiom

	(cd directory && $(MAKE))

so that a failure to cd into directory will generate an error for make.

The following patch is against the latest CVS sources.

	Enjoy!
	-- Mark
 
-------------- next part --------------
Index: Makefile.in
===================================================================
RCS file: /cvs/openssh_cvs/Makefile.in,v
retrieving revision 1.189
diff -u -p -r1.189 Makefile.in
--- Makefile.in	2001/10/22 00:53:59	1.189
+++ Makefile.in	2001/11/11 16:22:01
@@ -87,7 +87,7 @@ $(SSHDOBJS): config.h
 
 LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
 $(LIBCOMPAT): always
-	(cd openbsd-compat; $(MAKE))
+	(cd openbsd-compat && $(MAKE))
 always:
 
 libssh.a: $(LIBSSH_OBJS)
@@ -144,23 +144,23 @@ $(CONFIGFILES): $(CONFIGFILES_IN)
 clean:
 	rm -f *.o *.a $(TARGETS) logintest config.cache config.log 
 	rm -f *.out core 
-	(cd openbsd-compat; $(MAKE) clean)
+	(cd openbsd-compat && $(MAKE) clean)
 
 distclean:
 	rm -f *.o *.a $(TARGETS) logintest config.cache config.log 
 	rm -f *.out core
 	rm -f Makefile config.h config.status ssh_prng_cmds *~
 	rm -rf autom4te.cache
-	(cd openbsd-compat; $(MAKE) distclean)
-	(cd scard; $(MAKE) distclean)
+	(cd openbsd-compat && $(MAKE) distclean)
+	(cd scard && $(MAKE) distclean)
 
 veryclean:
 	rm -f configure config.h.in *.0
 	rm -f *.o *.a $(TARGETS) logintest config.cache config.log 
 	rm -f *.out core
 	rm -f Makefile config.h config.status ssh_prng_cmds *~
-	(cd openbsd-compat; $(MAKE) distclean)
-	(cd scard; $(MAKE) distclean)
+	(cd openbsd-compat && $(MAKE) distclean)
+	(cd scard && $(MAKE) distclean)
 
 mrproper: distclean
 
@@ -174,13 +174,13 @@ catman-do:
 
 distprep: catman-do
 	autoreconf
-	(cd scard ; $(MAKE) -f Makefile.in distprep)
+	(cd scard && $(MAKE) -f Makefile.in distprep)
 
 install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files host-key
 install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files
 
 scard-install:
-	(cd scard; $(MAKE) DESTDIR=$(DESTDIR) install)
+	(cd scard && $(MAKE) DESTDIR=$(DESTDIR) install)
 
 install-files: scard-install
 	$(srcdir)/mkinstalldirs $(DESTDIR)$(bindir)


More information about the openssh-unix-dev mailing list