Makefile: detect when PYTHON_PATH changes
When make is run, the python scripts are created from *.py files that are changed to use the python given by PYTHON_PATH. And PYTHON_PATH is set by default to /usr/bin/python on Linux. However, next time make is run with a different value in PYTHON_PATH, we failed to regenerate these scripts. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
f6f3921db6
commit
022250adfd
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
|||||||
/GIT-LDFLAGS
|
/GIT-LDFLAGS
|
||||||
/GIT-GUI-VARS
|
/GIT-GUI-VARS
|
||||||
/GIT-PREFIX
|
/GIT-PREFIX
|
||||||
|
/GIT-PYTHON-VARS
|
||||||
/GIT-SCRIPT-DEFINES
|
/GIT-SCRIPT-DEFINES
|
||||||
/GIT-USER-AGENT
|
/GIT-USER-AGENT
|
||||||
/GIT-VERSION-FILE
|
/GIT-VERSION-FILE
|
||||||
|
16
Makefile
16
Makefile
@ -2245,7 +2245,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
|
|||||||
endif # NO_PERL
|
endif # NO_PERL
|
||||||
|
|
||||||
ifndef NO_PYTHON
|
ifndef NO_PYTHON
|
||||||
$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX
|
$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS
|
||||||
$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
|
$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
|
||||||
$(QUIET_GEN)$(RM) $@ $@+ && \
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
||||||
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \
|
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \
|
||||||
@ -2636,6 +2636,18 @@ GIT-GUI-VARS: FORCE
|
|||||||
fi
|
fi
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
### Detect Python interpreter path changes
|
||||||
|
ifndef NO_PYTHON
|
||||||
|
TRACK_PYTHON = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)')
|
||||||
|
|
||||||
|
GIT-PYTHON-VARS: FORCE
|
||||||
|
@VARS='$(TRACK_PYTHON)'; \
|
||||||
|
if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
|
||||||
|
echo 1>&2 " * new Python interpreter location"; \
|
||||||
|
echo "$$VARS" >$@; \
|
||||||
|
fi
|
||||||
|
endif
|
||||||
|
|
||||||
test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
|
test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
|
||||||
|
|
||||||
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
|
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
|
||||||
@ -2911,7 +2923,7 @@ ifndef NO_TCLTK
|
|||||||
$(MAKE) -C git-gui clean
|
$(MAKE) -C git-gui clean
|
||||||
endif
|
endif
|
||||||
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
|
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
|
||||||
$(RM) GIT-USER-AGENT GIT-PREFIX GIT-SCRIPT-DEFINES
|
$(RM) GIT-USER-AGENT GIT-PREFIX GIT-SCRIPT-DEFINES GIT-PYTHON-VARS
|
||||||
|
|
||||||
.PHONY: all install profile-clean clean strip
|
.PHONY: all install profile-clean clean strip
|
||||||
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
|
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
|
||||||
|
Loading…
Reference in New Issue
Block a user