Mark D. Baushke
2001-Nov-11 16:31 UTC
[PATCH] do not invoke sub-make unless the 'cd directory' succeeds
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)
Damien Miller
2001-Nov-11 23:34 UTC
[PATCH] do not invoke sub-make unless the 'cd directory' succeeds
On Sun, 11 Nov 2001, Mark D. Baushke wrote:> 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))Applied - thanks. -d -- | By convention there is color, \\ Damien Miller <djm at mindrot.org> | By convention sweetness, By convention bitterness, \\ www.mindrot.org | But in reality there are atoms and space - Democritus (c. 400 BCE)