2.8: installation: reorder sections to match table order
[lttng-docs.git] / Makefile
index a66e8e14d5667c3597b658641b613f5220443a7d..f0ee1399653e1957e8c1fd43761144337979d5d9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,28 @@
+# Copyright 2016 Philippe Proulx <pproulx@efficios.com>
+
 CONF = asciidoc.html5.conf
 PREFIX = lttng-docs
-ALLVERSIONS = 2.5 2.6 2.7
+ALLVERSIONS = $(sort $(wildcard 2.*))
 
 ASCIIDOC = asciidoc -v -f $(CONF) -a source-highlighter=pygments
 RM = rm -rf
 
-htmldst = $(1)/$(PREFIX)-$(1).html
-
-.PHONY: all
+define vrule
+$(1)/$(PREFIX)-$(1).html: $(1)/$(PREFIX)-$(1).txt $(CONF)
+       $(ASCIIDOC) -a "lttng_version=$(1)" $(1)/$(PREFIX)-$(1).txt
 
-all: $(ALLVERSIONS)
+.PHONY: $(1)
 
-.PHONY: $(ALLVERSIONS)
+$(1): $(1)/$(PREFIX)-$(1).html
+endef
 
-2.5: $(call htmldst,2.5)
-
-2.6: $(call htmldst,2.6)
+.PHONY: all
 
-2.7: $(call htmldst,2.7)
+all: $(ALLVERSIONS)
 
-%.html: %.txt $(CONF)
-       $(ASCIIDOC) $<
+$(foreach v,$(ALLVERSIONS),$(eval $(call vrule,$(v))))
 
 .PHONY: clean
 
 clean:
-       $(RM) $(foreach version,$(ALLVERSIONS),$(call htmldst,$(version)))
+       $(RM) $(foreach v,$(ALLVERSIONS),$(v)/$(PREFIX)-$(v).html)
This page took 0.023225 seconds and 4 git commands to generate.