Skip to content

Commit 07981dc

Browse files
jrngitster
authored andcommitted
Makefile: rebuild perl scripts when perl paths change
Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0397305 commit 07981dc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/GIT-CFLAGS
33
/GIT-LDFLAGS
44
/GIT-PREFIX
5+
/GIT-PERL-DEFINES
56
/GIT-PYTHON-VARS
67
/GIT-SCRIPT-DEFINES
78
/GIT-USER-AGENT

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,8 @@ perl/PM.stamp: FORCE
17921792
perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
17931793
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
17941794

1795-
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
1795+
PERL_DEFINES = $(PERL_PATH_SQ)
1796+
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
17961797
$(QUIET_GEN)$(RM) $@ $@+ && \
17971798
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
17981799
sed -e '1{' \
@@ -1807,6 +1808,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
18071808
chmod +x $@+ && \
18081809
mv $@+ $@
18091810

1811+
GIT-PERL-DEFINES: FORCE
1812+
@FLAGS='$(PERL_DEFINES)'; \
1813+
if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
1814+
echo >&2 " * new perl-specific parameters"; \
1815+
echo "$$FLAGS" >$@; \
1816+
fi
1817+
18101818

18111819
.PHONY: gitweb
18121820
gitweb:
@@ -2494,7 +2502,8 @@ ifndef NO_TCLTK
24942502
$(MAKE) -C git-gui clean
24952503
endif
24962504
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS
2497-
$(RM) GIT-USER-AGENT GIT-PREFIX GIT-SCRIPT-DEFINES GIT-PYTHON-VARS
2505+
$(RM) GIT-USER-AGENT GIT-PREFIX
2506+
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS
24982507

24992508
.PHONY: all install profile-clean clean strip
25002509
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell

0 commit comments

Comments
 (0)