]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: move git-SCRIPT-DEFINES adjacent to $(SCRIPT_DEFINES)
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 21 Oct 2021 19:57:55 +0000 (21:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Oct 2021 23:17:56 +0000 (16:17 -0700)
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>
Makefile

index 381bed2c1d23b4bcc9d739b6fc34cc2cf80d87f3..f52402b24d8f797bcacb7f13c4fd29d8d9665117 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2256,6 +2256,13 @@ SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
        $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
        $(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\
        $(perllibdir_SQ)
+GIT-SCRIPT-DEFINES: FORCE
+       @FLAGS='$(SCRIPT_DEFINES)'; \
+           if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
+               echo >&2 "    * new script parameters"; \
+               echo "$$FLAGS" >$@; \
+            fi
+
 define cmd_munge_script
 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
     -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
@@ -2271,14 +2278,6 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
     $@.sh >$@+
 endef
 
-GIT-SCRIPT-DEFINES: FORCE
-       @FLAGS='$(SCRIPT_DEFINES)'; \
-           if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
-               echo >&2 "    * new script parameters"; \
-               echo "$$FLAGS" >$@; \
-            fi
-
-
 $(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \