Skip to content

Commit e706969

Browse files
committed
build-sys: add make rules for documentation
1 parent 1ad7f56 commit e706969

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
PYTHON = python
12
SED = sed
3+
SPHINX_BUILD = sphinx-build
24
INCLUDE_DIR = /usr/include/
5+
VERSION := $(shell $(PYTHON) setup.py --version)
6+
7+
define buildscript
8+
import sys,sysconfig
9+
print("build/lib.{}-{}.{}".format(sysconfig.get_platform(), *sys.version_info[:2]))
10+
endef
11+
12+
builddir := $(shell $(PYTHON) -c '$(buildscript)')
313

414
systemd/id128-constants.h: $(INCLUDE_DIR)/systemd/sd-messages.h
515
$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
16+
17+
SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
18+
sphinx-%:
19+
PYTHONPATH=$(builddir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) docs build/docs
20+
@echo Output has been generated in build/docs

0 commit comments

Comments
 (0)