-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
39 lines (25 loc) · 881 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.PHONY: all build docs clean clean_docs test
BUILD := poetry build --no-cache
# ensure poetry plugin blixbuild is installed
# version extratected from pyproject.toml
package := $(shell grep "^name" pyproject.toml | head -n1 | cut -d "=" -f 2 | sed 's/ //g' | sed 's/"//g')
docs_dst := $(package)/docs
docs_src := docs/build/markdown
docs := $(shell find $(docs_src) -type f -name "*.md")
version := $(shell grep "^version" pyproject.toml | cut -d "=" -f 2 | sed 's/ //g' | sed 's/"//g')
all: build
docs-%:
cd docs && poetry run make $*
docs: docs-html docs-markdown sync_docs
build: sync_docs
$(BUILD)
sync_docs: $(patsubst $(docs_src)/%.md, $(docs_dst)/%.md, $(docs))
$(docs_dst):
@echo "creating $(docs_dst)"
mkdir -p $(docs_dst)
$(docs_dst)/%.md: $(docs_src)/%.md | $(docs_dst)
@mkdir -p $(dir $@)
cp $< $@
clean: clean_docs
clean_docs:
rm -rf $(docs_dst)