missing quotes in gcc/Makefile.in (stmp-fixinc)

Toomas Rosin toomas@ns.tklabor.ee
Sun Apr 29 05:37:00 GMT 2001


Hello!

When I tell `make' to give command line options to shell, i.e. when I
run, e.g. make SHELL="/bin/sh -x", I will get a non-interrupting error
message when making the `stmp-fixinc' target:

    /bin/sh: -x: command not found

.  (Fortunately, the right thing happens anyway, only the "-x" is
ignored.)  This can be avoided thusly:

--- gcc-2.95.3/gcc/Makefile.in.orig
+++ gcc-2.95.3/gcc/Makefile.in
@@ -2161,7 +2161,7 @@
 stmp-fixinc: fixinc.sh gsyslimits.h
 	rm -rf include; mkdir include
 	TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \
-	INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\
+	INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL='$(SHELL)' ;\
 	export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \
 	$(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS)
 	rm -f include/syslimits.h

By the way, I have always wondered about a "philosophical" question:
why are "&&" and "set -e" so seldom used in makerules?  Not in
Makefiles for GCC only, but just about everywhere?  Are they not
portable?  I would have guessed using one or the other of them in all
multi-command rules would be a good practice.

Peace,
Toomas.



More information about the Gcc-bugs mailing list