]> git.sur5r.net Git - i3/i3/commitdiff
Move docs to the new Makefile layout
authorQuentin Glidic <sardemff7+git@sardemff7.net>
Sun, 17 Jun 2012 12:31:45 +0000 (14:31 +0200)
committerQuentin Glidic <sardemff7+git@sardemff7.net>
Sun, 22 Jul 2012 17:57:48 +0000 (19:57 +0200)
Makefile
common.mk
docs/docs.mk [new file with mode: 0644]

index ba0ed0020bade8056c701cab28eebb7007632d77..5374527dc16f86249ab195df6ae55a1ae269ca7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ include i3-input/i3-input.mk
 include i3-nagbar/i3-nagbar.mk
 include i3bar/i3bar.mk
 include i3-dump-log/i3-dump-log.mk
+include docs/docs.mk
 
 real-all: $(ALL_TARGETS)
 
@@ -33,7 +34,7 @@ dist: distclean
        # Only copy toplevel documentation (important stuff)
        mkdir i3-${VERSION}/docs
        # Pre-generate documentation
-       $(MAKE) -C docs
+       $(MAKE) docs
        $(MAKE) -C i3bar/doc
        # Cleanup τεχ output files
        find docs -regex ".*\.\(aux\|out\|log\|toc\|bm\|dvi\|log\)" -exec rm '{}' \;
@@ -51,7 +52,6 @@ dist: distclean
 
 clean: $(CLEAN_TARGETS)
        (which lcov >/dev/null 2>&1 && lcov -d . --zerocounters) || true
-       $(MAKE) -C docs clean
        $(MAKE) -C man clean
 
 distclean: clean $(DISTCLEAN_TARGETS)
index 25e812009b72c19e97144ef0841087c73557b5f8..2f550cffe9e9b48e5e7a9a0619b3e09bb433423e 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -144,6 +144,9 @@ V ?= 0
 ifeq ($(V),0)
 # Don’t print command lines which are run
 .SILENT:
+
+# echo-ing vars
+V_ASCIIDOC = echo ASCIIDOC $@;
 endif
 
 # Always remake the following targets
diff --git a/docs/docs.mk b/docs/docs.mk
new file mode 100644 (file)
index 0000000..773c832
--- /dev/null
@@ -0,0 +1,35 @@
+DISTCLEAN_TARGETS += clean-docs
+
+# To pass additional parameters for asciidoc
+ASCIIDOC = asciidoc
+
+ASCIIDOC_NOTOC_TARGETS = \
+       docs/debugging.html \
+       docs/debugging-release-version.html
+
+ASCIIDOC_TOC_TARGETS = \
+       docs/hacking-howto.html \
+       docs/userguide.html \
+       docs/ipc.html \
+       docs/multi-monitor.html \
+       docs/wsbar.html \
+       docs/testsuite.html \
+       docs/i3bar-protocol.html
+
+ASCIIDOC_TARGETS = \
+       $(ASCIIDOC_TOC_TARGETS) \
+       $(ASCIIDOC_NOTOC_TARGETS)
+
+ASCIIDOC_CALL = $(V_ASCIIDOC)$(ASCIIDOC) -n $(ASCIIDOC_FLAGS) -o $@ $<
+ASCIIDOC_TOC_CALL = $(V_ASCIIDOC)$(ASCIIDOC) -a toc -n $(ASCIIDOC_FLAGS) -o $@ $<
+
+docs: $(ASCIIDOC_TARGETS)
+
+$(ASCIIDOC_TOC_TARGETS): docs/%.html: docs/%
+       $(ASCIIDOC_TOC_CALL)
+
+$(ASCIIDOC_NOTOC_TARGETS): docs/%.html: docs/%
+       $(ASCIIDOC_CALL)
+
+clean-docs:
+       rm -f $(ASCIIDOC_TARGETS)