2009-11-18 02:42:32 +01:00
|
|
|
#
|
|
|
|
# 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
|
2010-03-21 20:01:50 +01:00
|
|
|
ifeq ($(uname_S),FreeBSD)
|
|
|
|
PYTHON_PATH = /usr/local/bin/python
|
|
|
|
else
|
|
|
|
PYTHON_PATH = /usr/bin/python
|
|
|
|
endif
|
2009-11-18 02:42:32 +01:00
|
|
|
endif
|
|
|
|
ifndef prefix
|
|
|
|
prefix = $(HOME)
|
|
|
|
endif
|
|
|
|
ifndef V
|
|
|
|
QUIET = @
|
|
|
|
QUIETSETUP = --quiet
|
|
|
|
endif
|
|
|
|
|
|
|
|
PYLIBDIR=$(shell $(PYTHON_PATH) -c \
|
|
|
|
"import sys; \
|
2013-01-20 14:15:31 +01:00
|
|
|
print('lib/python%i.%i/site-packages' % sys.version_info[:2])")
|
2009-11-18 02:42:32 +01:00
|
|
|
|
2013-01-20 14:15:33 +01:00
|
|
|
py_version=$(shell $(PYTHON_PATH) -c \
|
|
|
|
'import sys; print("%i.%i" % sys.version_info[:2])')
|
|
|
|
|
2009-11-18 02:42:32 +01:00
|
|
|
all: $(pysetupfile)
|
2013-01-20 14:15:33 +01:00
|
|
|
$(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
|
2009-11-18 02:42:32 +01:00
|
|
|
|
|
|
|
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
|
2013-01-30 20:30:10 +01:00
|
|
|
$(RM) *.pyo *.pyc GIT-PYTHON-VERSION
|