Skip to content

Commit 64c07db

Browse files
jrngitster
authored andcommitted
Makefile: simplify by using SCRIPT_{PERL,SH}_GEN macros
SCRIPT_PERL_GEN is defined as $(patsubst %.perl,%,$(SCRIPT_PERL)) for use in targets like build-perl-script used by makefiles in subdirectories that override SCRIPT_PERL (see v1.8.2-rc0~17^2, "git-remote-mediawiki: use toplevel's Makefile", 2013-02-08). The same expression is used in the rules that actually write the generated perl scripts, and since these rules were introduced before SCRIPT_PERL_GEN, they use the longhand instead of that macro. Use the macro to make reading easier. Likewise for SCRIPT_SH_GEN. The Python rules already got the same simplification in v1.8.4-rc0~162^2~8 (2013-05-24). Signed-off-by: Jonathan Nieder <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e204b00 commit 64c07db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ GIT-SCRIPT-DEFINES: FORCE
17871787
fi
17881788

17891789

1790-
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-SCRIPT-DEFINES
1790+
$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
17911791
$(QUIET_GEN)$(cmd_munge_script) && \
17921792
chmod +x $@+ && \
17931793
mv $@+ $@
@@ -1802,10 +1802,10 @@ git.res: git.rc GIT-VERSION-FILE
18021802
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
18031803

18041804
# This makes sure we depend on the NO_PERL setting itself.
1805-
$(patsubst %.perl,%,$(SCRIPT_PERL)): GIT-BUILD-OPTIONS
1805+
$(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
18061806

18071807
ifndef NO_PERL
1808-
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
1808+
$(SCRIPT_PERL_GEN): perl/perl.mak
18091809

18101810
perl/perl.mak: perl/PM.stamp
18111811

@@ -1818,7 +1818,7 @@ perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
18181818
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
18191819

18201820
PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ)
1821-
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
1821+
$(SCRIPT_PERL_GEN): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
18221822
$(QUIET_GEN)$(RM) $@ $@+ && \
18231823
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
18241824
INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
@@ -1852,7 +1852,7 @@ git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES
18521852
chmod +x $@+ && \
18531853
mv $@+ $@
18541854
else # NO_PERL
1855-
$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
1855+
$(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh
18561856
$(QUIET_GEN)$(RM) $@ $@+ && \
18571857
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
18581858
-e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \

0 commit comments

Comments
 (0)