Makefile: move git-SCRIPT-DEFINES adjacent to $(SCRIPT_DEFINES)
When "GIT-SCRIPT-DEFINES" was added in e4dd89ab984 (Makefile: update scripts when build-time parameters change, 2012-06-20) the rules for generating the scripts themselves were moved further away from the "cmd_munge_script" added in 46bac904581 (Do not install shell libraries executable, 2010-01-31). Let's move these around so that the variables and defines needed by given targets immediately precede them. This is not needed for any subsequent changes to work, but makes the code consistent with how GIT-PERL-DEFINES is structured. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Oct 21, 2021 at 21:57 UTC
7212f2887aef735e7d9c9a8d803b21e275c2a878
1 file changed
+7
-8
Makefile
+7
-8
@@ -2256,6 +2256,13 @@ SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
2256
$(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
2257
$(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\
2258
$(perllibdir_SQ)
2259
+GIT-SCRIPT-DEFINES: FORCE
2260
+ @FLAGS='$(SCRIPT_DEFINES)'; \
2261
+ if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
2262
+ echo >&2 " * new script parameters"; \
2263
+ echo "$$FLAGS" >$@; \
2264
+ fi
2265
+
2266
define cmd_munge_script
2267
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2268
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
@@ -2271,14 +2278,6 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2278
$@.sh >$@+
2279
endef
2280
2274
-GIT-SCRIPT-DEFINES: FORCE
2275
- @FLAGS='$(SCRIPT_DEFINES)'; \
2276
- if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
2277
- echo >&2 " * new script parameters"; \
2278
- echo "$$FLAGS" >$@; \
2279
- fi
2280
-
2281
-
2281
$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
2282
$(QUIET_GEN)$(cmd_munge_script) && \
2283
chmod +x $@+ && \