-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathMakefile
43 lines (27 loc) · 844 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
40
41
42
43
# Copyright 2016 Philippe Proulx <pproulx@efficios.com>
CONF = asciidoc.html5.conf
PREFIX = lttng-docs
ALLVERSIONS = $(sort $(wildcard 2.*))
ALLCHECK = $(foreach v, $(ALLVERSIONS), check-$(v))
ASCIIDOC = asciidoc -v -f $(CONF) -a source-highlighter=pygments
RM = rm -rf
define vrule
$(1)/$(PREFIX)-$(1).html: $(1)/$(PREFIX)-$(1).txt $(CONF)
$(ASCIIDOC) -a "lttng_version=$(1)" $(1)/$(PREFIX)-$(1).txt
.PHONY: $(1)
$(1): $(1)/$(PREFIX)-$(1).html
view-$(1):
xdg-open $(1)/$(PREFIX)-$(1).html
.PHONY: view-$(1)
check-$(1): $(1)/$(PREFIX)-$(1).txt $(CONF)
python3 tools/check.py $(1)/$(PREFIX)-$(1).txt
.PHONY: check-$(1)
endef
.PHONY: all
all: $(ALLVERSIONS)
$(foreach v,$(ALLVERSIONS),$(eval $(call vrule,$(v))))
.PHONY: check
check: $(ALLCHECK)
.PHONY: clean
clean:
$(RM) $(foreach v,$(ALLVERSIONS),$(v)/$(PREFIX)-$(v).html)