@matheusbsbs / matheus-bagliano / commits / 6dc4627ef4
Fork 0

Makefile: add a target which will abort compilation with ancient shells

This adds a make target which can be used to try to execute certain shell constructs which are required for compiling and running git. This patch provides a test for the $() notation for command substition which is used in the Makefile and extensively in the git scripts. The make target is named in such a way as to be a hint to the user that SHELL_PATH should be set to an appropriate shell. If the shell command fails, the user should receive a message similar to the following: make: *** [please_set_SHELL_PATH_to_a_more_modern_shell] Error 2 Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Aug 7, 2008 at 14:06 UTC 6dc4627ef4eb40aeb9b328270b189ca27c061f7a
1 file changed +7 -1
Makefile
+7 -1
@@ -1062,7 +1062,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
1062
1063 SHELL = $(SHELL_PATH)
1064
1065 -all:: $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
1065 +all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
1066 ifneq (,$X)
1067 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$p';)
1068 endif
@@ -1075,6 +1075,11 @@ endif
1075 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
1076 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
1077
1078 +please_set_SHELL_PATH_to_a_more_modern_shell:
1079 + @$$(:)
1080 +
1081 +shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
1082 +
1083 strip: $(PROGRAMS) git$X
1084 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
1085
@@ -1457,6 +1462,7 @@ endif
1462 $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
1463
1464 .PHONY: all install clean strip
1465 +.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
1466 .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS
1467 .PHONY: .FORCE-GIT-BUILD-OPTIONS
1468