python-systemd/Makefile

48 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

# SPDX-License-Identifier: LGPL-2.1-or-later
PYTHON = python
SED = sed
ETAGS = etags
INCLUDE_DIR := $(shell pkg-config --variable=includedir libsystemd)
INCLUDE_FLAGS := $(shell pkg-config --cflags libsystemd)
VERSION := $(shell meson introspect --projectinfo build | jq -r .version)
TESTFLAGS = -v
BUILD_DIR = build
2015-07-08 14:49:46 -04:00
all: build
build:
$(PYTHON) -m build -Cbuild-dir=$(BUILD_DIR)
2015-07-08 14:49:46 -04:00
install:
$(PYTHON) -m pip install .
dist:
$(PYTHON) -m build --sdist
2016-12-12 20:15:05 -05:00
sign: dist/systemd-python-$(VERSION).tar.gz
gpg --detach-sign -a dist/systemd-python-$(VERSION).tar.gz
2015-08-07 11:38:21 -04:00
clean:
rm -rf $(BUILD_DIR) systemd/*.so systemd/*.py[co] *.py[co] systemd/__pycache__
2015-08-07 11:38:21 -04:00
distclean: clean
rm -rf dist MANIFEST
2015-08-07 11:38:21 -04:00
check: build install
($(PYTHON) -m pytest src/systemd/test docs $(TESTFLAGS))
2016-09-22 09:59:04 -04:00
www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
doc-sync:
rsync -rlv --delete --omit-dir-times $(BUILD_DIR)/html/ $(www_target)/
2016-09-22 09:59:04 -04:00
2016-12-12 20:15:05 -05:00
upload: dist/systemd-python-$(VERSION).tar.gz dist/systemd-python-$(VERSION).tar.gz.asc
twine-3 upload $+
TAGS: $(shell git ls-files systemd/*.[ch])
$(ETAGS) $+
shell:
$(PYTHON)
.PHONY: build install dist sign upload clean distclean TAGS doc doc-sync shell