From 95f7c4722399964142aac1813c72f566d84d4d72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Sep 2009 11:03:38 +0200 Subject: Integrate documentation generation into the build system --- documentation/cxx/tree/manual/makefile | 53 ++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 9 deletions(-) (limited to 'documentation/cxx/tree/manual/makefile') diff --git a/documentation/cxx/tree/manual/makefile b/documentation/cxx/tree/manual/makefile index bfdd6d3..1586cfb 100644 --- a/documentation/cxx/tree/manual/makefile +++ b/documentation/cxx/tree/manual/makefile @@ -1,12 +1,47 @@ -.PHONY: all -all: cxx-tree-manual.ps cxx-tree-manual.pdf +# file : documentation/cxx/tree/manual/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file -cxx-tree-manual.pdf: cxx-tree-manual.ps - ps2pdf14 $< +include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make -cxx-tree-manual.ps: index.xhtml manual.html2ps - html2ps -f manual.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-tree-manual.ps cxx-tree-manual.pdf +.PHONY: $(default) $(dist) $(dist-win) $(cleandoc) + +# Build. +# +$(default): $(out_base)/cxx-tree-manual.ps $(out_base)/cxx-tree-manual.pdf + + +$(out_base)/cxx-tree-manual.ps: $(src_base)/index.xhtml \ + $(src_base)/manual.html2ps \ + | $(out_base)/. + $(call message,html2ps $<,html2ps -f $(src_base)/manual.html2ps -o $@ $<) + +$(out_base)/cxx-tree-manual.pdf: $(out_base)/cxx-tree-manual.ps | $(out_base)/. + $(call message,ps2pdf $<,ps2pdf14 $< $@) + +# Dist. +# +$(dist): path := $(subst $(src_root)/,,$(src_base)) +$(dist): $(out_base)/cxx-tree-manual.ps $(out_base)/cxx-tree-manual.pdf + $(call install-data,$(src_base)/index.xhtml,$(dist_prefix)/$(path)/index.xhtml) + $(call install-data,$(out_base)/cxx-tree-manual.ps,$(dist_prefix)/$(path)/cxx-tree-manual.ps) + $(call install-data,$(out_base)/cxx-tree-manual.pdf,$(dist_prefix)/$(path)/cxx-tree-manual.pdf) + +$(dist-win): $(dist) + + +# Clean +# +$(cleandoc): + $(call message,rm $$1,rm -f $$1,$(out_base)/cxx-tree-manual.ps) + $(call message,rm $$1,rm -f $$1,$(out_base)/cxx-tree-manual.pdf) + +# How to. +# +$(call include,$(bld_root)/install.make) -- cgit v1.1