python-systemd/Makefile

44 lines
1 KiB
Makefile
Raw Permalink Normal View History

PYTHON = python
SED = sed
SPHINX_BUILD = sphinx-build
ETAGS = etags
INCLUDE_DIR = /usr/include/
VERSION := $(shell $(PYTHON) setup.py --version)
TESTFLAGS = -v
define buildscript
import sys,sysconfig
print("build/lib.{}-{}.{}".format(sysconfig.get_platform(), *sys.version_info[:2]))
endef
builddir := $(shell $(PYTHON) -c '$(buildscript)')
2015-07-08 14:49:46 -04:00
all: build
build:
2015-07-08 14:49:46 -04:00
$(PYTHON) setup.py build
install:
$(PYTHON) setup.py install --skip-build $(if $(DESTDIR),--root $(DESTDIR))
dist:
$(PYTHON) setup.py sdist
2015-08-07 11:38:21 -04:00
clean:
rm -rf build systemd/*.so systemd/*.py[co] *.py[co] systemd/__pycache__
distclean: clean
rm -rf dist MANIFEST systemd/id128-constants.h
SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
2015-07-08 14:49:46 -04:00
sphinx-%: build
PYTHONPATH=$(builddir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) docs build/$*
@echo Output has been generated in build/docs
2015-07-08 14:49:46 -04:00
check: build
(cd $(builddir) && $(PYTHON) -m py.test . ../../docs $(TESTFLAGS))
TAGS: $(shell git ls-files systemd/*.[ch])
$(ETAGS) $+
.PHONY: build install dist clean distclean TAGS