diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-05 14:56:56 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-05 14:56:56 -0700 |
commit | 854afacb8e64ef9c45d1e1cf3fe11a74692ba988 (patch) | |
tree | 9947f8beeb46302a1dbcecd70389a9116b333b5b /Makefile | |
parent | Merge branch 'nd/urls-doc-no-file-hyperlink-fix' (diff) | |
parent | build: do not install git-remote-testpy (diff) | |
download | tgif-854afacb8e64ef9c45d1e1cf3fe11a74692ba988.tar.xz |
Merge branch 'fc/makefile'
Update Makefile to use handy automatic variables where appropriate,
and stop installing a script that is only used for testing.
* fc/makefile:
build: do not install git-remote-testpy
build: add NO_INSTALL variable
build: cleanup using $<
build: cleanup using $^
build: trivial simplification
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 42 |
1 files changed, 24 insertions, 18 deletions
@@ -495,11 +495,17 @@ SCRIPT_PERL += git-svn.perl SCRIPT_PYTHON += git-remote-testpy.py SCRIPT_PYTHON += git-p4.py +NO_INSTALL += git-remote-testpy + # Generated files for scripts SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH)) SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL)) SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON)) +SCRIPT_SH_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_SH_GEN)) +SCRIPT_PERL_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PERL_GEN)) +SCRIPT_PYTHON_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PYTHON_GEN)) + # Individual rules to allow e.g. # "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script" # from subdirectories like contrib/*/ @@ -509,12 +515,12 @@ build-sh-script: $(SCRIPT_SH_GEN) build-python-script: $(SCRIPT_PYTHON_GEN) .PHONY: install-perl-script install-sh-script install-python-script -install-sh-script: $(SCRIPT_SH_GEN) - $(INSTALL) $(SCRIPT_SH_GEN) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' -install-perl-script: $(SCRIPT_PERL_GEN) - $(INSTALL) $(SCRIPT_PERL_GEN) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' -install-python-script: $(SCRIPT_PYTHON_GEN) - $(INSTALL) $(SCRIPT_PYTHON_GEN) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' +install-sh-script: $(SCRIPT_SH_INS) + $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' +install-perl-script: $(SCRIPT_PERL_INS) + $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' +install-python-script: $(SCRIPT_PYTHON_INS) + $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' .PHONY: clean-perl-script clean-sh-script clean-python-script clean-sh-script: @@ -524,9 +530,9 @@ clean-perl-script: clean-python-script: $(RM) $(SCRIPT_PYTHON_GEN) -SCRIPTS = $(SCRIPT_SH_GEN) \ - $(SCRIPT_PERL_GEN) \ - $(SCRIPT_PYTHON_GEN) \ +SCRIPTS = $(SCRIPT_SH_INS) \ + $(SCRIPT_PERL_INS) \ + $(SCRIPT_PYTHON_INS) \ git-instaweb ETAGS_TARGET = TAGS @@ -1671,7 +1677,7 @@ please_set_SHELL_PATH_to_a_more_modern_shell: shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell strip: $(PROGRAMS) git$X - $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X + $(STRIP) $(STRIP_OPTS) $^ ### Target-specific flags and dependencies @@ -1731,9 +1737,9 @@ version.sp version.s version.o: EXTRA_CPPFLAGS = \ $(BUILT_INS): git$X $(QUIET_BUILT_IN)$(RM) $@ && \ - ln git$X $@ 2>/dev/null || \ - ln -s git$X $@ 2>/dev/null || \ - cp git$X $@ + ln $< $@ 2>/dev/null || \ + ln -s $< $@ 2>/dev/null || \ + cp $< $@ common-cmds.h: ./generate-cmdlist.sh command-list.txt @@ -1798,7 +1804,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE -e ' x' \ -e '}' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ - $@.perl >$@+ && \ + $< >$@+ && \ chmod +x $@+ && \ mv $@+ $@ @@ -1822,8 +1828,8 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh endif # NO_PERL ifndef NO_PYTHON -$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS -$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py +$(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS +$(SCRIPT_PYTHON_GEN): % : %.py $(QUIET_GEN)$(RM) $@ $@+ && \ INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \ --no-print-directory prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' \ @@ -1831,11 +1837,11 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \ -e 's|\(os\.getenv("GITPYTHONLIB"\)[^)]*)|\1,"@@INSTLIBDIR@@")|' \ -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ - $@.py >$@+ && \ + $< >$@+ && \ chmod +x $@+ && \ mv $@+ $@ else # NO_PYTHON -$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh +$(SCRIPT_PYTHON_GEN): % : unimplemented.sh $(QUIET_GEN)$(RM) $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \ |