git_remote_helpers / Makefileon commit Merge branch 'tr/maint-apply-non-git-patch-parsefix' (ad76feb)
   1#
   2# Makefile for the git_remote_helpers python support modules
   3#
   4pysetupfile:=setup.py
   5
   6# Shell quote (do not use $(call) to accommodate ancient setups);
   7DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
   8
   9ifndef PYTHON_PATH
  10        ifeq ($(uname_S),FreeBSD)
  11                PYTHON_PATH = /usr/local/bin/python
  12        else
  13                PYTHON_PATH = /usr/bin/python
  14        endif
  15endif
  16ifndef prefix
  17        prefix = $(HOME)
  18endif
  19ifndef V
  20        QUIET = @
  21        QUIETSETUP = --quiet
  22endif
  23
  24PYLIBDIR=$(shell $(PYTHON_PATH) -c \
  25         "import sys; \
  26         print('lib/python%i.%i/site-packages' % sys.version_info[:2])")
  27
  28py_version=$(shell $(PYTHON_PATH) -c \
  29        'import sys; print("%i.%i" % sys.version_info[:2])')
  30
  31all: $(pysetupfile)
  32        $(QUIET)test "$$(cat GIT-PYTHON-VERSION 2>/dev/null)" = "$(py_version)" || \
  33        flags=--force; \
  34        $(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build $$flags
  35        $(QUIET)echo "$(py_version)" >GIT-PYTHON-VERSION
  36
  37install: $(pysetupfile)
  38        $(PYTHON_PATH) $(pysetupfile) install --prefix $(DESTDIR_SQ)$(prefix)
  39
  40instlibdir: $(pysetupfile)
  41        @echo "$(DESTDIR_SQ)$(prefix)/$(PYLIBDIR)"
  42
  43clean:
  44        $(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) clean -a
  45        $(RM) *.pyo *.pyc GIT-PYTHON-VERSION