mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
![Junio C Hamano](/assets/img/avatar_default.png)
fadf8c7
(git_remote_helpers: force rebuild if python version changes, 2013-01-20)
started using a marker file to keep track of the version of Python interpreter
used for the last build, but forgot to remove it when asked to "make clean".
Acked-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
46 lines
1.1 KiB
Makefile
46 lines
1.1 KiB
Makefile
#
|
|
# Makefile for the git_remote_helpers python support modules
|
|
#
|
|
pysetupfile:=setup.py
|
|
|
|
# Shell quote (do not use $(call) to accommodate ancient setups);
|
|
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
|
|
|
ifndef PYTHON_PATH
|
|
ifeq ($(uname_S),FreeBSD)
|
|
PYTHON_PATH = /usr/local/bin/python
|
|
else
|
|
PYTHON_PATH = /usr/bin/python
|
|
endif
|
|
endif
|
|
ifndef prefix
|
|
prefix = $(HOME)
|
|
endif
|
|
ifndef V
|
|
QUIET = @
|
|
QUIETSETUP = --quiet
|
|
endif
|
|
|
|
PYLIBDIR=$(shell $(PYTHON_PATH) -c \
|
|
"import sys; \
|
|
print('lib/python%i.%i/site-packages' % sys.version_info[:2])")
|
|
|
|
py_version=$(shell $(PYTHON_PATH) -c \
|
|
'import sys; print("%i.%i" % sys.version_info[:2])')
|
|
|
|
all: $(pysetupfile)
|
|
$(QUIET)test "$$(cat GIT-PYTHON-VERSION 2>/dev/null)" = "$(py_version)" || \
|
|
flags=--force; \
|
|
$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build $$flags
|
|
$(QUIET)echo "$(py_version)" >GIT-PYTHON-VERSION
|
|
|
|
install: $(pysetupfile)
|
|
$(PYTHON_PATH) $(pysetupfile) install --prefix $(DESTDIR_SQ)$(prefix)
|
|
|
|
instlibdir: $(pysetupfile)
|
|
@echo "$(DESTDIR_SQ)$(prefix)/$(PYLIBDIR)"
|
|
|
|
clean:
|
|
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) clean -a
|
|
$(RM) *.pyo *.pyc GIT-PYTHON-VERSION
|