Makefile: build instaweb similar to other scripts
Instaweb would not properly rebuild if the build-time parameters changed. Fix this by depending on the GIT-SCRIPT-DEFINES meta-file and using $(cmd_munge_script) like all the other shell scripts. This requires adding a few new parametres to cmd_munge_script, but that doesn't hurt existing scripts. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jun 20, 2012 at 14:32 UTC
b5295f322c8828e913a3ef126ddffc6862235b03
1 file changed
+6
-8
Makefile
+6
-8
@@ -2008,7 +2008,8 @@ common-cmds.h: $(wildcard Documentation/git-*.txt)
2008
$(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
2009
2010
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
2011
- $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ)
2011
+ $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
2012
+ $(gitwebdir_SQ):$(PERL_PATH_SQ)
2013
define cmd_munge_script
2014
$(RM) $@ $@+ && \
2015
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
@@ -2018,6 +2019,8 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2019
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
2020
-e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
2021
-e $(BROKEN_PATH_FIX) \
2022
+ -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
2023
+ -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
2024
$@.sh >$@+
2025
endef
2026
@@ -2064,13 +2067,8 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
2067
gitweb:
2068
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
2069
2067
-git-instaweb: git-instaweb.sh gitweb
2068
- $(QUIET_GEN)$(RM) $@ $@+ && \
2069
- sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2070
- -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
2071
- -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
2072
- -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
2073
- $@.sh > $@+ && \
2070
+git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES
2071
+ $(QUIET_GEN)$(cmd_munge_script) && \
2072
chmod +x $@+ && \
2073
mv $@+ $@
2074
else # NO_PERL