summaryrefslogtreecommitdiff
path: root/documentation/cxx/parser/guide
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-18 11:03:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-18 11:03:38 +0200
commit95f7c4722399964142aac1813c72f566d84d4d72 (patch)
tree36172642e634ab67fc94faf99c7d89df3a6b92e5 /documentation/cxx/parser/guide
parentc34af468acc94691d0a5954eae38a89506bc620e (diff)
Integrate documentation generation into the build system
Diffstat (limited to 'documentation/cxx/parser/guide')
-rw-r--r--documentation/cxx/parser/guide/makefile55
1 files changed, 46 insertions, 9 deletions
diff --git a/documentation/cxx/parser/guide/makefile b/documentation/cxx/parser/guide/makefile
index ca76286..1d85874 100644
--- a/documentation/cxx/parser/guide/makefile
+++ b/documentation/cxx/parser/guide/makefile
@@ -1,12 +1,49 @@
-.PHONY: all
-all: cxx-parser-guide.ps cxx-parser-guide.pdf
+# file : documentation/cxx/parser/guide/makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-cxx-parser-guide.pdf: cxx-parser-guide.ps
- ps2pdf14 $<
+include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
-cxx-parser-guide.ps: index.xhtml guide.html2ps
- html2ps -f guide.html2ps -o $@ $<
+default := $(out_base)/
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+cleandoc := $(out_base)/.cleandoc
-.PHONY: clean
-clean:
- rm -f cxx-parser-guide.ps cxx-parser-guide.pdf
+.PHONY: $(default) $(dist) $(dist-win) $(cleandoc)
+
+# Build.
+#
+$(default): $(out_base)/cxx-parser-guide.ps $(out_base)/cxx-parser-guide.pdf
+
+
+$(out_base)/cxx-parser-guide.ps: $(src_base)/index.xhtml \
+ $(src_base)/figure-1.png \
+ $(src_base)/guide.html2ps \
+ | $(out_base)/.
+ $(call message,html2ps $<,html2ps -f $(src_base)/guide.html2ps -o $@ $<)
+
+$(out_base)/cxx-parser-guide.pdf: $(out_base)/cxx-parser-guide.ps | $(out_base)/.
+ $(call message,ps2pdf $<,ps2pdf14 $< $@)
+
+# Dist.
+#
+$(dist): path := $(subst $(src_root)/,,$(src_base))
+$(dist): $(out_base)/cxx-parser-guide.ps $(out_base)/cxx-parser-guide.pdf
+ $(call install-data,$(src_base)/figure-1.png,$(dist_prefix)/$(path)/figure-1.png)
+ $(call install-data,$(src_base)/index.xhtml,$(dist_prefix)/$(path)/index.xhtml)
+ $(call install-data,$(out_base)/cxx-parser-guide.ps,$(dist_prefix)/$(path)/cxx-parser-guide.ps)
+ $(call install-data,$(out_base)/cxx-parser-guide.pdf,$(dist_prefix)/$(path)/cxx-parser-guide.pdf)
+
+$(dist-win): $(dist)
+
+
+# Clean
+#
+$(cleandoc):
+ $(call message,rm $$1,rm -f $$1,$(out_base)/cxx-parser-guide.ps)
+ $(call message,rm $$1,rm -f $$1,$(out_base)/cxx-parser-guide.pdf)
+
+# How to.
+#
+$(call include,$(bld_root)/install.make)