Commit | Line | Data |
---|---|---|
7adf7ee2 PP |
1 | # Copyright 2016 Philippe Proulx <pproulx@efficios.com> |
2 | ||
f0287ae1 PP |
3 | CONF = asciidoc.html5.conf |
4 | PREFIX = lttng-docs | |
7adf7ee2 | 5 | ALLVERSIONS = $(sort $(wildcard 2.*)) |
f9167c82 | 6 | ALLCHECK = $(foreach v, $(ALLVERSIONS), check-$(v)) |
f0287ae1 PP |
7 | |
8 | ASCIIDOC = asciidoc -v -f $(CONF) -a source-highlighter=pygments | |
9 | RM = rm -rf | |
10 | ||
7adf7ee2 PP |
11 | define vrule |
12 | $(1)/$(PREFIX)-$(1).html: $(1)/$(PREFIX)-$(1).txt $(CONF) | |
13 | $(ASCIIDOC) -a "lttng_version=$(1)" $(1)/$(PREFIX)-$(1).txt | |
f0287ae1 | 14 | |
7adf7ee2 | 15 | .PHONY: $(1) |
f0287ae1 | 16 | |
7adf7ee2 | 17 | $(1): $(1)/$(PREFIX)-$(1).html |
4026b681 PP |
18 | |
19 | view-$(1): | |
20 | xdg-open $(1)/$(PREFIX)-$(1).html | |
21 | ||
22 | .PHONY: view-$(1) | |
f9167c82 KS |
23 | |
24 | check-$(1): $(1)/$(PREFIX)-$(1).txt $(CONF) | |
25 | python3 tools/check.py $(1)/$(PREFIX)-$(1).txt | |
26 | ||
27 | .PHONY: check-$(1) | |
7adf7ee2 | 28 | endef |
f0287ae1 | 29 | |
7adf7ee2 | 30 | .PHONY: all |
f0287ae1 | 31 | |
7adf7ee2 | 32 | all: $(ALLVERSIONS) |
f0287ae1 | 33 | |
7adf7ee2 | 34 | $(foreach v,$(ALLVERSIONS),$(eval $(call vrule,$(v)))) |
f0287ae1 | 35 | |
f9167c82 KS |
36 | .PHONY: check |
37 | ||
38 | check: $(ALLCHECK) | |
39 | ||
f0287ae1 PP |
40 | .PHONY: clean |
41 | ||
42 | clean: | |
7adf7ee2 | 43 | $(RM) $(foreach v,$(ALLVERSIONS),$(v)/$(PREFIX)-$(v).html) |