2025-10-03 16:17:33 +02:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
|
|
2015-07-08 14:47:46 -04:00
|
|
|
PYTHON = python
|
2015-07-05 14:39:14 -04:00
|
|
|
SED = sed
|
2015-10-26 22:51:52 -04:00
|
|
|
ETAGS = etags
|
2016-09-21 19:54:45 -04:00
|
|
|
INCLUDE_DIR := $(shell pkg-config --variable=includedir libsystemd)
|
2017-03-19 11:06:48 -04:00
|
|
|
INCLUDE_FLAGS := $(shell pkg-config --cflags libsystemd)
|
2025-06-30 12:07:47 +07:00
|
|
|
VERSION := $(shell meson introspect --projectinfo build | jq -r .version)
|
2015-10-27 00:12:00 -04:00
|
|
|
TESTFLAGS = -v
|
2025-06-30 12:07:47 +07:00
|
|
|
BUILD_DIR = build
|
2015-07-05 14:39:14 -04:00
|
|
|
|
2015-07-08 14:49:46 -04:00
|
|
|
all: build
|
|
|
|
|
|
2015-10-15 15:27:57 +02:00
|
|
|
build:
|
2025-06-30 12:07:47 +07:00
|
|
|
$(PYTHON) -m build -Cbuild-dir=$(BUILD_DIR)
|
2015-07-08 14:49:46 -04:00
|
|
|
|
2015-07-08 15:29:50 -04:00
|
|
|
install:
|
2025-06-30 12:07:47 +07:00
|
|
|
$(PYTHON) -m pip install .
|
2015-07-08 15:29:50 -04:00
|
|
|
|
|
|
|
|
dist:
|
2025-06-30 12:07:47 +07:00
|
|
|
$(PYTHON) -m build --sdist
|
2015-07-08 15:29:50 -04:00
|
|
|
|
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:
|
2025-06-30 12:07:47 +07:00
|
|
|
rm -rf $(BUILD_DIR) systemd/*.so systemd/*.py[co] *.py[co] systemd/__pycache__
|
2015-08-07 11:38:21 -04:00
|
|
|
|
|
|
|
|
distclean: clean
|
2016-09-21 19:54:45 -04:00
|
|
|
rm -rf dist MANIFEST
|
2015-08-07 11:38:21 -04:00
|
|
|
|
2025-06-30 12:07:47 +07:00
|
|
|
check: build install
|
|
|
|
|
($(PYTHON) -m pytest src/systemd/test docs $(TESTFLAGS))
|
2015-10-27 00:12:00 -04:00
|
|
|
|
2016-09-22 09:59:04 -04:00
|
|
|
www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd
|
|
|
|
|
doc-sync:
|
2025-06-30 12:07:47 +07:00
|
|
|
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 $+
|
|
|
|
|
|
2015-10-26 22:51:52 -04:00
|
|
|
TAGS: $(shell git ls-files systemd/*.[ch])
|
|
|
|
|
$(ETAGS) $+
|
|
|
|
|
|
2017-03-19 12:58:41 -04:00
|
|
|
shell:
|
2025-06-30 12:07:47 +07:00
|
|
|
$(PYTHON)
|
2017-03-19 12:58:41 -04:00
|
|
|
|
|
|
|
|
.PHONY: build install dist sign upload clean distclean TAGS doc doc-sync shell
|