aboutsummaryrefslogtreecommitdiff
path: root/documentation/makefile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-11 19:01:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-11 19:15:28 +0200
commit592587e0073cb6722f1fc9c0833d441ad5636358 (patch)
tree98bc152bf5ff7ee45190139640d68806ce2cd80f /documentation/makefile
parent676cf6420dbc11c15322ca528386a8032b9872a0 (diff)
Initial work on CLI port
Add options files with all the documentation. Move documentation and usage to use the new approach. Finally get rid of dependency on libbackend-elements.
Diffstat (limited to 'documentation/makefile')
-rw-r--r--documentation/makefile115
1 files changed, 107 insertions, 8 deletions
diff --git a/documentation/makefile b/documentation/makefile
index bedb174..4a8de5b 100644
--- a/documentation/makefile
+++ b/documentation/makefile
@@ -11,25 +11,112 @@ dist := $(out_base)/.dist
dist-win := $(out_base)/.dist-win
cleandoc := $(out_base)/.cleandoc
-$(default): $(out_base)/cxx/
+# Import.
+#
+$(call import,\
+ $(scf_root)/import/cli/stub.make,\
+ cli: cli,cli-rules: cli_rules)
+
+# Build.
+#
+$(default): \
+$(out_base)/cxx/ \
+$(out_base)/xsd.xhtml \
+$(out_base)/xsd.1
+
+# Man/html pages.
+#
+$(out_base)/xsd.xhtml $(out_base)/xsd.1: cli := $(cli)
+$(out_base)/xsd.xhtml $(out_base)/xsd.1: cli_options += -I $(src_root)/xsd
+
+$(out_base)/xsd.xhtml $(out_base)/xsd.1: \
+$(src_root)/xsd/options.cli \
+$(src_root)/xsd/cxx/options.cli \
+$(src_root)/xsd/cxx/tree/options.cli \
+$(src_root)/xsd/cxx/parser/options.cli
+
+# Assemble the options from different files in a specific order.
+#
+
+# XHTML
+#
+$(out_base)/xsd.xhtml: $(src_base)/xsd-prologue.xhtml \
+ $(src_base)/xsd-epilogue.xhtml \
+ $(src_base)/xsd-tree-header.xhtml \
+ $(src_base)/xsd-parser-header.xhtml \
+ | $(out_base)/.
+# Common options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base --class CXX::options \
+--class options --html-prologue $(src_base)/xsd-prologue.xhtml \
+$$1 >$@, $(src_root)/xsd/cxx/options.cli)
+
+# C++/Tree options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base \
+--html-prologue $(src_base)/xsd-tree-header.xhtml \
+$$1 >>$@, $(src_root)/xsd/cxx/tree/options.cli)
+
+# C++/Parser options.
+#
+ $(call message,cli-html $$1,$(cli) $(cli_options) --generate-html \
+--stdout --suppress-undocumented --exclude-base \
+--html-prologue $(src_base)/xsd-parser-header.xhtml \
+--html-epilogue $(src_base)/xsd-epilogue.xhtml \
+$$1 >>$@, $(src_root)/xsd/cxx/parser/options.cli)
+
+# MAN
+#
+$(out_base)/xsd.1: $(src_base)/xsd-prologue.1 \
+ $(src_base)/xsd-epilogue.1 \
+ $(src_base)/xsd-tree-header.1 \
+ $(src_base)/xsd-parser-header.1 \
+ | $(out_base)/.
+# Common options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base --class CXX::options \
+--class options --man-prologue $(src_base)/xsd-prologue.1 \
+$$1 >$@, $(src_root)/xsd/cxx/options.cli)
+
+# C++/Tree options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base \
+--man-prologue $(src_base)/xsd-tree-header.1 \
+$$1 >>$@, $(src_root)/xsd/cxx/tree/options.cli)
+
+# C++/Parser options.
+#
+ $(call message,cli-man $$1,$(cli) $(cli_options) --generate-man \
+--stdout --suppress-undocumented --exclude-base \
+--man-prologue $(src_base)/xsd-parser-header.1 \
+--man-epilogue $(src_base)/xsd-epilogue.1 \
+$$1 >>$@, $(src_root)/xsd/cxx/parser/options.cli)
+
# Install.
#
-$(install): $(out_base)/cxx/.install
+$(install): $(out_base)/cxx/.install \
+ $(out_base)/xsd.xhtml \
+ $(out_base)/xsd.1
$(call install-data,$(src_base)/default.css,$(install_doc_dir)/xsd/default.css)
$(call install-data,$(src_base)/schema-authoring-guide.xhtml,$(install_doc_dir)/xsd/schema-authoring-guide.xhtml)
- $(call install-data,$(src_base)/xsd.xhtml,$(install_doc_dir)/xsd/xsd.xhtml)
+ $(call install-data,$(out_base)/xsd.xhtml,$(install_doc_dir)/xsd/xsd.xhtml)
$(call install-data,$(src_base)/custom-literals.xsd,$(install_doc_dir)/xsd/custom-literals.xsd)
- $(call install-data,$(src_base)/xsd.1,$(install_man_dir)/man1/xsd.1)
+ $(call install-data,$(out_base)/xsd.1,$(install_man_dir)/man1/xsd.1)
# Dist.
#
dist-common := $(out_base)/.dist-common
-$(dist-common):
+$(dist-common): $(out_base)/xsd.xhtml \
+ $(out_base)/xsd.1
$(call install-data,$(src_base)/default.css,$(dist_prefix)/documentation/default.css)
- $(call install-data,$(src_base)/xsd.xhtml,$(dist_prefix)/documentation/xsd.xhtml)
- $(call install-data,$(src_base)/xsd.1,$(dist_prefix)/documentation/xsd.1)
+ $(call install-data,$(out_base)/xsd.xhtml,$(dist_prefix)/documentation/xsd.xhtml)
+ $(call install-data,$(out_base)/xsd.1,$(dist_prefix)/documentation/xsd.1)
$(call install-data,$(src_base)/schema-authoring-guide.xhtml,$(dist_prefix)/documentation/schema-authoring-guide.xhtml)
$(call install-data,$(src_base)/custom-literals.xsd,$(dist_prefix)/documentation/custom-literals.xsd)
@@ -39,7 +126,19 @@ $(dist-win): $(dist-common) $(out_base)/cxx/.dist-win
# Clean.
#
$(cleandoc): $(src_base)/cxx/.cleandoc
+ $(call message,rm $$1,rm -f $$1,$(out_base)/xsd.1)
+ $(call message,rm $$1,rm -f $$1,$(out_base)/xsd.xhtml)
-$(call include,$(bld_root)/install.make)
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(out_base)/xsd.xhtml $(out_base)/xsd.1: | $(out_base)/.gitignore
+$(out_base)/.gitignore: files := xsd.1 xsd.xhtml
+$(clean): $(out_base)/.gitignore.clean
+
+$(call include,$(bld_root)/git/gitignore.make)
+endif
+
+$(call include,$(bld_root)/install.make)
$(call import,$(src_base)/cxx/makefile)