summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/cxx/parser/generated/makefile25
-rw-r--r--examples/cxx/parser/hello/makefile24
-rw-r--r--examples/cxx/parser/library/makefile28
-rw-r--r--examples/cxx/parser/makefile24
-rw-r--r--examples/cxx/parser/mixed/makefile27
-rw-r--r--examples/cxx/parser/mixin/makefile27
-rw-r--r--examples/cxx/parser/multiroot/makefile31
-rw-r--r--examples/cxx/parser/performance/makefile30
-rw-r--r--examples/cxx/parser/polymorphism/makefile26
-rw-r--r--examples/cxx/parser/polyroot/makefile29
-rw-r--r--examples/cxx/parser/wildcard/makefile25
-rw-r--r--examples/cxx/tree/binary/boost/makefile29
-rw-r--r--examples/cxx/tree/binary/cdr/makefile26
-rw-r--r--examples/cxx/tree/binary/makefile41
-rw-r--r--examples/cxx/tree/binary/xdr/makefile24
-rw-r--r--examples/cxx/tree/caching/makefile25
-rw-r--r--examples/cxx/tree/custom/calendar/makefile28
-rw-r--r--examples/cxx/tree/custom/comments/makefile28
-rw-r--r--examples/cxx/tree/custom/contacts/makefile26
-rw-r--r--examples/cxx/tree/custom/double/makefile25
-rw-r--r--examples/cxx/tree/custom/makefile38
-rw-r--r--examples/cxx/tree/custom/taxonomy/makefile28
-rw-r--r--examples/cxx/tree/custom/wildcard/makefile27
-rw-r--r--examples/cxx/tree/dbxml/makefile26
-rw-r--r--examples/cxx/tree/hello/makefile25
-rw-r--r--examples/cxx/tree/library/makefile24
-rw-r--r--examples/cxx/tree/makefile44
-rw-r--r--examples/cxx/tree/messaging/makefile31
-rw-r--r--examples/cxx/tree/mixed/makefile24
-rw-r--r--examples/cxx/tree/multiroot/makefile28
-rw-r--r--examples/cxx/tree/performance/makefile31
-rw-r--r--examples/cxx/tree/polymorphism/makefile25
-rw-r--r--examples/cxx/tree/streaming/makefile24
-rw-r--r--examples/cxx/tree/wildcard/makefile24
-rw-r--r--examples/cxx/tree/xpath/makefile29
-rw-r--r--examples/makefile10
36 files changed, 887 insertions, 99 deletions
diff --git a/examples/cxx/parser/generated/makefile b/examples/cxx/parser/generated/makefile
index 031e59e..2c8d571 100644
--- a/examples/cxx/parser/generated/makefile
+++ b/examples/cxx/parser/generated/makefile
@@ -10,8 +10,11 @@ xsd := library.xsd
obj := $(addprefix $(out_base)/,$(xsd:.xsd=-pskel.o) $(xsd:.xsd=-pimpl.o) $(xsd:.xsd=-driver.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/$(xsd:.xsd=-driver)
-clean := $(out_base)/.clean
+
+driver := $(out_base)/$(xsd:.xsd=-driver)
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
#
@@ -48,6 +51,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -76,6 +96,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
xsd_parser_impl_suffix := -pimpl
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/hello/makefile b/examples/cxx/parser/hello/makefile
index 48f39d2..2ead3fa 100644
--- a/examples/cxx/parser/hello/makefile
+++ b/examples/cxx/parser/hello/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -42,6 +44,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/hello.xsd,$(dist_prefix)/$(path)/hello.xsd)
+ $(call install-data,$(src_base)/hello.xml,$(dist_prefix)/$(path)/hello.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -69,6 +88,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/library/makefile b/examples/cxx/parser/library/makefile
index 0d88942..bc4ab73 100644
--- a/examples/cxx/parser/library/makefile
+++ b/examples/cxx/parser/library/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx library-pimpl.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,27 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+ $(call install-data,$(src_base)/library.map,$(dist_prefix)/$(path)/library.map)
+ $(call install-data,$(src_base)/library.hxx,$(dist_prefix)/$(path)/library.hxx)
+ $(call install-data,$(src_base)/library-pimpl.hxx,$(dist_prefix)/$(path)/library-pimpl.hxx)
+ $(call install-data,$(src_base)/library-pimpl.cxx,$(dist_prefix)/$(path)/library-pimpl.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -70,6 +93,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/makefile b/examples/cxx/parser/makefile
index 25d9c54..9f3e27d 100644
--- a/examples/cxx/parser/makefile
+++ b/examples/cxx/parser/makefile
@@ -8,12 +8,28 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
examples := generated hello library mixin mixed multiroot performance \
polymorphism polyroot wildcard
-default := $(out_base)/
-clean := $(out_base)/.clean
-
-.PHONY: $(default) $(clean)
+default := $(out_base)/
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
+# Build
+#
$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
+
+# Dist
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
+# Clean
+#
$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
diff --git a/examples/cxx/parser/mixed/makefile b/examples/cxx/parser/mixed/makefile
index 5da80ee..4d1fb0c 100644
--- a/examples/cxx/parser/mixed/makefile
+++ b/examples/cxx/parser/mixed/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,26 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/text.xsd,$(dist_prefix)/$(path)/text.xsd)
+ $(call install-data,$(src_base)/text.xml,$(dist_prefix)/$(path)/text.xml)
+ $(call install-data,$(src_base)/text.map,$(dist_prefix)/$(path)/text.map)
+ $(call install-data,$(src_base)/anchor.hxx,$(dist_prefix)/$(path)/anchor.hxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -70,6 +92,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/mixin/makefile b/examples/cxx/parser/mixin/makefile
index 104db00..bb3927c 100644
--- a/examples/cxx/parser/mixin/makefile
+++ b/examples/cxx/parser/mixin/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,26 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/schema.xsd,$(dist_prefix)/$(path)/schema.xsd)
+ $(call install-data,$(src_base)/instance.xml,$(dist_prefix)/$(path)/instance.xml)
+ $(call install-data,$(src_base)/schema.map,$(dist_prefix)/$(path)/schema.map)
+ $(call install-data,$(src_base)/types.hxx,$(dist_prefix)/$(path)/types.hxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -70,6 +92,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/multiroot/makefile b/examples/cxx/parser/multiroot/makefile
index 988ecbf..02b9f57 100644
--- a/examples/cxx/parser/multiroot/makefile
+++ b/examples/cxx/parser/multiroot/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx protocol-pimpl.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,29 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/protocol.xsd,$(dist_prefix)/$(path)/protocol.xsd)
+ $(call install-data,$(src_base)/balance.xml,$(dist_prefix)/$(path)/balance.xml)
+ $(call install-data,$(src_base)/deposit.xml,$(dist_prefix)/$(path)/deposit.xml)
+ $(call install-data,$(src_base)/withdraw.xml,$(dist_prefix)/$(path)/withdraw.xml)
+ $(call install-data,$(src_base)/protocol.map,$(dist_prefix)/$(path)/protocol.map)
+ $(call install-data,$(src_base)/protocol.hxx,$(dist_prefix)/$(path)/protocol.hxx)
+ $(call install-data,$(src_base)/protocol-pimpl.hxx,$(dist_prefix)/$(path)/protocol-pimpl.hxx)
+ $(call install-data,$(src_base)/protocol-pimpl.cxx,$(dist_prefix)/$(path)/protocol-pimpl.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -70,9 +95,9 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
-
# Dependencies.
#
$(call import,$(src_root)/xsd/makefile)
diff --git a/examples/cxx/parser/performance/makefile b/examples/cxx/parser/performance/makefile
index 80e0e60..15938c9 100644
--- a/examples/cxx/parser/performance/makefile
+++ b/examples/cxx/parser/performance/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx time.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,29 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/test.xsd,$(dist_prefix)/$(path)/test.xsd)
+ $(call install-data,$(src_base)/test-5k.xml,$(dist_prefix)/$(path)/test-5k.xml)
+ $(call install-data,$(src_base)/test-50k.xml,$(dist_prefix)/$(path)/test-50k.xml)
+ $(call install-data,$(src_base)/test-500k.xml,$(dist_prefix)/$(path)/test-500k.xml)
+ $(call install-data,$(src_base)/time.hxx,$(dist_prefix)/$(path)/time.hxx)
+ $(call install-data,$(src_base)/time.cxx,$(dist_prefix)/$(path)/time.cxx)
+ $(call install-data,$(src_base)/gen.cxx,$(dist_prefix)/$(path)/gen.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -70,6 +95,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/polymorphism/makefile b/examples/cxx/parser/polymorphism/makefile
index f53700b..954518b 100644
--- a/examples/cxx/parser/polymorphism/makefile
+++ b/examples/cxx/parser/polymorphism/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx supermen-pimpl.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,25 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/supermen.xsd,$(dist_prefix)/$(path)/supermen.xsd)
+ $(call install-data,$(src_base)/supermen.xml,$(dist_prefix)/$(path)/supermen.xml)
+ $(call install-data,$(src_base)/supermen-pimpl.hxx,$(dist_prefix)/$(path)/supermen-pimpl.hxx)
+ $(call install-data,$(src_base)/supermen-pimpl.cxx,$(dist_prefix)/$(path)/supermen-pimpl.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -70,6 +91,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/polyroot/makefile b/examples/cxx/parser/polyroot/makefile
index a62465d..007e1b9 100644
--- a/examples/cxx/parser/polyroot/makefile
+++ b/examples/cxx/parser/polyroot/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx supermen-pimpl.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,28 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/supermen.xsd,$(dist_prefix)/$(path)/supermen.xsd)
+ $(call install-data,$(src_base)/batman.xml,$(dist_prefix)/$(path)/batman.xml)
+ $(call install-data,$(src_base)/person.xml,$(dist_prefix)/$(path)/person.xml)
+ $(call install-data,$(src_base)/superman.xml,$(dist_prefix)/$(path)/superman.xml)
+ $(call install-data,$(src_base)/supermen-pimpl.hxx,$(dist_prefix)/$(path)/supermen-pimpl.hxx)
+ $(call install-data,$(src_base)/supermen-pimpl.cxx,$(dist_prefix)/$(path)/supermen-pimpl.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -70,6 +94,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/wildcard/makefile b/examples/cxx/parser/wildcard/makefile
index 7345926..8587bfc 100644
--- a/examples/cxx/parser/wildcard/makefile
+++ b/examples/cxx/parser/wildcard/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -42,6 +44,24 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/email.xsd,$(dist_prefix)/$(path)/email.xsd)
+ $(call install-data,$(src_base)/email.xml,$(dist_prefix)/$(path)/email.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -69,6 +89,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/parser/xsd-cxx.make)
diff --git a/examples/cxx/tree/binary/boost/makefile b/examples/cxx/tree/binary/boost/makefile
index de332f8..0da560b 100644
--- a/examples/cxx/tree/binary/boost/makefile
+++ b/examples/cxx/tree/binary/boost/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -21,9 +23,11 @@ $(call import,\
$(scf_root)/import/libxerces-c/stub.make,\
l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
+ifeq ($(filter $(MAKECMDGOALS),dist dist-win),)
$(call import,\
$(scf_root)/import/libboost/serialization/stub.make,\
l: boost_serialization.l,cpp-options: boost_serialization.l.cpp-options)
+endif
# Build.
@@ -52,6 +56,26 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+ $(call install-data,$(src_base)/library-prologue.hxx,$(dist_prefix)/$(path)/library-prologue.hxx)
+ $(call install-data,$(src_base)/boost-archive-extraction.hxx,$(dist_prefix)/$(path)/boost-archive-extraction.hxx)
+ $(call install-data,$(src_base)/boost-archive-insertion.hxx,$(dist_prefix)/$(path)/boost-archive-insertion.hxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -79,6 +103,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/binary/cdr/makefile b/examples/cxx/tree/binary/cdr/makefile
index 25e88e7..e1cd456 100644
--- a/examples/cxx/tree/binary/cdr/makefile
+++ b/examples/cxx/tree/binary/cdr/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -21,9 +23,11 @@ $(call import,\
$(scf_root)/import/libxerces-c/stub.make,\
l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
+ifeq ($(filter $(MAKECMDGOALS),dist dist-win),)
$(call import,\
$(scf_root)/import/libace/stub.make,\
l: ace.l,cpp-options: ace.l.cpp-options)
+endif
# Build.
@@ -48,6 +52,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -75,6 +96,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/binary/makefile b/examples/cxx/tree/binary/makefile
index f30fc66..b2c111f 100644
--- a/examples/cxx/tree/binary/makefile
+++ b/examples/cxx/tree/binary/makefile
@@ -5,26 +5,47 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
-examples :=
+all_examples := boost cdr xdr
+build_examples :=
ifeq ($(xsd_with_boost_serialization),y)
-examples += boost
+build_examples += boost
endif
ifeq ($(xsd_with_ace),y)
-examples += cdr
+build_examples += cdr
endif
ifeq ($(xsd_with_xdr),y)
-examples += xdr
+build_examples += xdr
endif
-default := $(out_base)/
-clean := $(out_base)/.clean
+default := $(out_base)/
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
-.PHONY: $(default) $(clean)
+# Build.
+#
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+# Dist.
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
+# Clean.
+#
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
+
+ifneq ($(filter $(MAKECMDGOALS),dist dist-win),)
+$(foreach e,$(all_examples),$(call import,$(src_base)/$e/makefile))
+else
+$(foreach e,$(build_examples),$(call import,$(src_base)/$e/makefile))
+endif
diff --git a/examples/cxx/tree/binary/xdr/makefile b/examples/cxx/tree/binary/xdr/makefile
index cd61637..b517dcc 100644
--- a/examples/cxx/tree/binary/xdr/makefile
+++ b/examples/cxx/tree/binary/xdr/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
#
@@ -42,6 +44,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -69,6 +88,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/caching/makefile b/examples/cxx/tree/caching/makefile
index 45587a9..891f383 100644
--- a/examples/cxx/tree/caching/makefile
+++ b/examples/cxx/tree/caching/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,24 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -70,6 +90,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/custom/calendar/makefile b/examples/cxx/tree/custom/calendar/makefile
index 129333f..ada22c0 100644
--- a/examples/cxx/tree/custom/calendar/makefile
+++ b/examples/cxx/tree/custom/calendar/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx xml-schema-custom.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -21,9 +23,11 @@ $(call import,\
$(scf_root)/import/libxerces-c/stub.make,\
l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
+ifeq ($(filter $(MAKECMDGOALS),dist dist-win),)
$(call import,\
$(scf_root)/import/libboost/date-time/stub.make,\
l: boost_date_time.l,cpp-options: boost_date_time.l.cpp-options)
+endif
# Build.
#
@@ -63,6 +67,25 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/calendar.xsd,$(dist_prefix)/$(path)/calendar.xsd)
+ $(call install-data,$(src_base)/calendar.xml,$(dist_prefix)/$(path)/calendar.xml)
+ $(call install-data,$(src_base)/xml-schema-custom.hxx,$(dist_prefix)/$(path)/xml-schema-custom.hxx)
+ $(call install-data,$(src_base)/xml-schema-custom.cxx,$(dist_prefix)/$(path)/xml-schema-custom.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -91,6 +114,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/custom/comments/makefile b/examples/cxx/tree/custom/comments/makefile
index f1074ec..d79e78c 100644
--- a/examples/cxx/tree/custom/comments/makefile
+++ b/examples/cxx/tree/custom/comments/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx xml-schema-custom.cxx dom-parse.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -57,6 +59,27 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/people.xsd,$(dist_prefix)/$(path)/people.xsd)
+ $(call install-data,$(src_base)/people.xml,$(dist_prefix)/$(path)/people.xml)
+ $(call install-data,$(src_base)/xml-schema-custom.hxx,$(dist_prefix)/$(path)/xml-schema-custom.hxx)
+ $(call install-data,$(src_base)/xml-schema-custom.cxx,$(dist_prefix)/$(path)/xml-schema-custom.cxx)
+ $(call install-data,$(src_base)/dom-parse.hxx,$(dist_prefix)/$(path)/dom-parse.hxx)
+ $(call install-data,$(src_base)/dom-parse.cxx,$(dist_prefix)/$(path)/dom-parse.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -85,6 +108,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/custom/contacts/makefile b/examples/cxx/tree/custom/contacts/makefile
index d4ddbe5..8483f42 100644
--- a/examples/cxx/tree/custom/contacts/makefile
+++ b/examples/cxx/tree/custom/contacts/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx contacts-custom.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -51,6 +53,25 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/contacts.xsd,$(dist_prefix)/$(path)/contacts.xsd)
+ $(call install-data,$(src_base)/contacts.xml,$(dist_prefix)/$(path)/contacts.xml)
+ $(call install-data,$(src_base)/contacts-custom.hxx,$(dist_prefix)/$(path)/contacts-custom.hxx)
+ $(call install-data,$(src_base)/contacts-custom.cxx,$(dist_prefix)/$(path)/contacts-custom.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -78,6 +99,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/custom/double/makefile b/examples/cxx/tree/custom/double/makefile
index e8bec43..0e1ed1d 100644
--- a/examples/cxx/tree/custom/double/makefile
+++ b/examples/cxx/tree/custom/double/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx double-custom.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -52,6 +54,24 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/order.xsd,$(dist_prefix)/$(path)/order.xsd)
+ $(call install-data,$(src_base)/double-custom.hxx,$(dist_prefix)/$(path)/double-custom.hxx)
+ $(call install-data,$(src_base)/double-custom.cxx,$(dist_prefix)/$(path)/double-custom.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -80,6 +100,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/custom/makefile b/examples/cxx/tree/custom/makefile
index c29fd03..961916e 100644
--- a/examples/cxx/tree/custom/makefile
+++ b/examples/cxx/tree/custom/makefile
@@ -5,18 +5,40 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
-examples := comments contacts double taxonomy wildcard
+all_examples := comments contacts double taxonomy wildcard calendar
+build_examples := comments contacts double taxonomy wildcard
ifeq ($(xsd_with_boost_date_time),y)
-examples += calendar
+build_examples += calendar
endif
-default := $(out_base)/
-clean := $(out_base)/.clean
+default := $(out_base)/
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
-.PHONY: $(default) $(clean)
+# Build.
+#
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+# Dist.
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
+# Clean.
+#
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
+
+ifneq ($(filter $(MAKECMDGOALS),dist dist-win),)
+$(foreach e,$(all_examples),$(call import,$(src_base)/$e/makefile))
+else
+$(foreach e,$(build_examples),$(call import,$(src_base)/$e/makefile))
+endif
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
diff --git a/examples/cxx/tree/custom/taxonomy/makefile b/examples/cxx/tree/custom/taxonomy/makefile
index 02ea144..26e27cf 100644
--- a/examples/cxx/tree/custom/taxonomy/makefile
+++ b/examples/cxx/tree/custom/taxonomy/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx people-custom.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -56,6 +58,27 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/people.xsd,$(dist_prefix)/$(path)/people.xsd)
+ $(call install-data,$(src_base)/people.xml,$(dist_prefix)/$(path)/people.xml)
+ $(call install-data,$(src_base)/people-custom.hxx,$(dist_prefix)/$(path)/people-custom.hxx)
+ $(call install-data,$(src_base)/people-custom.cxx,$(dist_prefix)/$(path)/people-custom.cxx)
+ $(call install-data,$(src_base)/people-custom-fwd.hxx,$(dist_prefix)/$(path)/people-custom-fwd.hxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -83,6 +106,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/custom/wildcard/makefile b/examples/cxx/tree/custom/wildcard/makefile
index 49c5306..a813d27 100644
--- a/examples/cxx/tree/custom/wildcard/makefile
+++ b/examples/cxx/tree/custom/wildcard/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx wildcard-custom.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -53,6 +55,26 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/wildcard.xsd,$(dist_prefix)/$(path)/wildcard.xsd)
+ $(call install-data,$(src_base)/wildcard.xml,$(dist_prefix)/$(path)/wildcard.xml)
+ $(call install-data,$(src_base)/wildcard-custom.hxx,$(dist_prefix)/$(path)/wildcard-custom.hxx)
+ $(call install-data,$(src_base)/wildcard-custom.cxx,$(dist_prefix)/$(path)/wildcard-custom.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -80,6 +102,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/dbxml/makefile b/examples/cxx/tree/dbxml/makefile
index 424a6b8..d3c176a 100644
--- a/examples/cxx/tree/dbxml/makefile
+++ b/examples/cxx/tree/dbxml/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -21,9 +23,11 @@ $(call import,\
$(scf_root)/import/libxerces-c/stub.make,\
l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
+ifeq ($(filter $(MAKECMDGOALS),dist dist-win),)
$(call import,\
$(scf_root)/import/libdbxml/stub.make,\
l: dbxml.l,cpp-options: dbxml.l.cpp-options)
+endif
# Build.
@@ -47,6 +51,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -74,6 +95,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/hello/makefile b/examples/cxx/tree/hello/makefile
index 6994941..6d3a11b 100644
--- a/examples/cxx/tree/hello/makefile
+++ b/examples/cxx/tree/hello/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,24 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/hello.xsd,$(dist_prefix)/$(path)/hello.xsd)
+ $(call install-data,$(src_base)/hello.xml,$(dist_prefix)/$(path)/hello.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -70,6 +90,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/library/makefile b/examples/cxx/tree/library/makefile
index 83446c3..b683f45 100644
--- a/examples/cxx/tree/library/makefile
+++ b/examples/cxx/tree/library/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -44,6 +46,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
+ $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -71,6 +90,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/makefile b/examples/cxx/tree/makefile
index 7866b33..8b7a665 100644
--- a/examples/cxx/tree/makefile
+++ b/examples/cxx/tree/makefile
@@ -5,23 +5,47 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
-examples := binary caching custom hello library messaging mixed multiroot \
-performance polymorphism streaming wildcard
+all_examples := binary caching custom hello library messaging mixed \
+multiroot performance polymorphism streaming wildcard dbxml xpath
+
+build_examples := binary caching custom hello library messaging mixed \
+multiroot performance polymorphism streaming wildcard
ifeq ($(xsd_with_dbxml),y)
-examples += dbxml
+build_examples += dbxml
endif
ifeq ($(xsd_with_xqilla),y)
-examples += xpath
+build_examples += xpath
endif
-default := $(out_base)/
-clean := $(out_base)/.clean
+default := $(out_base)/
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
+
+# Build.
+#
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
+
+# Dist.
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
-.PHONY: $(default) $(clean)
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
+# Clean.
+#
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
+
+
+ifneq ($(filter $(MAKECMDGOALS),dist dist-win),)
+$(foreach e,$(all_examples),$(call import,$(src_base)/$e/makefile))
+else
+$(foreach e,$(build_examples),$(call import,$(src_base)/$e/makefile))
+endif
diff --git a/examples/cxx/tree/messaging/makefile b/examples/cxx/tree/messaging/makefile
index 7f7ced1..40f036b 100644
--- a/examples/cxx/tree/messaging/makefile
+++ b/examples/cxx/tree/messaging/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx dom-parse.cxx dom-serialize.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -46,6 +48,30 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/protocol.xsd,$(dist_prefix)/$(path)/protocol.xsd)
+ $(call install-data,$(src_base)/balance.xml,$(dist_prefix)/$(path)/balance.xml)
+ $(call install-data,$(src_base)/deposit.xml,$(dist_prefix)/$(path)/deposit.xml)
+ $(call install-data,$(src_base)/withdraw.xml,$(dist_prefix)/$(path)/withdraw.xml)
+ $(call install-data,$(src_base)/dom-parse.hxx,$(dist_prefix)/$(path)/dom-parse.hxx)
+ $(call install-data,$(src_base)/dom-parse.cxx,$(dist_prefix)/$(path)/dom-parse.cxx)
+ $(call install-data,$(src_base)/dom-serialize.hxx,$(dist_prefix)/$(path)/dom-serialize.hxx)
+ $(call install-data,$(src_base)/dom-serialize.cxx,$(dist_prefix)/$(path)/dom-serialize.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -73,6 +99,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/mixed/makefile b/examples/cxx/tree/mixed/makefile
index b2e6338..fa1f1df 100644
--- a/examples/cxx/tree/mixed/makefile
+++ b/examples/cxx/tree/mixed/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -44,6 +46,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/text.xsd,$(dist_prefix)/$(path)/text.xsd)
+ $(call install-data,$(src_base)/text.xml,$(dist_prefix)/$(path)/text.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -71,6 +90,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
diff --git a/examples/cxx/tree/multiroot/makefile b/examples/cxx/tree/multiroot/makefile
index 0a6be1f..12a2744 100644
--- a/examples/cxx/tree/multiroot/makefile
+++ b/examples/cxx/tree/multiroot/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx dom-parse.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,27 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/protocol.xsd,$(dist_prefix)/$(path)/protocol.xsd)
+ $(call install-data,$(src_base)/balance.xml,$(dist_prefix)/$(path)/balance.xml)
+ $(call install-data,$(src_base)/deposit.xml,$(dist_prefix)/$(path)/deposit.xml)
+ $(call install-data,$(src_base)/withdraw.xml,$(dist_prefix)/$(path)/withdraw.xml)
+ $(call install-data,$(src_base)/dom-parse.hxx,$(dist_prefix)/$(path)/dom-parse.hxx)
+ $(call install-data,$(src_base)/dom-parse.cxx,$(dist_prefix)/$(path)/dom-parse.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -70,6 +93,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/performance/makefile b/examples/cxx/tree/performance/makefile
index 46cd783..6024180 100644
--- a/examples/cxx/tree/performance/makefile
+++ b/examples/cxx/tree/performance/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx parsing.cxx serialization.cxx time.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -43,6 +45,30 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/parsing.cxx,$(dist_prefix)/$(path)/parsing.cxx)
+ $(call install-data,$(src_base)/serialization.cxx,$(dist_prefix)/$(path)/serialization.cxx)
+ $(call install-data,$(src_base)/test.xsd,$(dist_prefix)/$(path)/test.xsd)
+ $(call install-data,$(src_base)/test-5k.xml,$(dist_prefix)/$(path)/test-5k.xml)
+ $(call install-data,$(src_base)/test-50k.xml,$(dist_prefix)/$(path)/test-50k.xml)
+ $(call install-data,$(src_base)/test-500k.xml,$(dist_prefix)/$(path)/test-500k.xml)
+ $(call install-data,$(src_base)/time.hxx,$(dist_prefix)/$(path)/time.hxx)
+ $(call install-data,$(src_base)/time.cxx,$(dist_prefix)/$(path)/time.cxx)
+ $(call install-data,$(src_base)/gen.cxx,$(dist_prefix)/$(path)/gen.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -70,6 +96,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/polymorphism/makefile b/examples/cxx/tree/polymorphism/makefile
index f9319d0..86fd232 100644
--- a/examples/cxx/tree/polymorphism/makefile
+++ b/examples/cxx/tree/polymorphism/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -45,6 +47,24 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/supermen.xsd,$(dist_prefix)/$(path)/supermen.xsd)
+ $(call install-data,$(src_base)/supermen.xml,$(dist_prefix)/$(path)/supermen.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -72,6 +92,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/streaming/makefile b/examples/cxx/tree/streaming/makefile
index f023af4..3a501e3 100644
--- a/examples/cxx/tree/streaming/makefile
+++ b/examples/cxx/tree/streaming/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -44,6 +46,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/records.xsd,$(dist_prefix)/$(path)/records.xsd)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+
# Clean.
#
@@ -72,6 +91,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/wildcard/makefile b/examples/cxx/tree/wildcard/makefile
index 2e11468..9386314 100644
--- a/examples/cxx/tree/wildcard/makefile
+++ b/examples/cxx/tree/wildcard/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -44,6 +46,23 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/email.xsd,$(dist_prefix)/$(path)/email.xsd)
+ $(call install-data,$(src_base)/email.xml,$(dist_prefix)/$(path)/email.xml)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -71,6 +90,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/cxx/tree/xpath/makefile b/examples/cxx/tree/xpath/makefile
index a8ce9d9..22362c5 100644
--- a/examples/cxx/tree/xpath/makefile
+++ b/examples/cxx/tree/xpath/makefile
@@ -11,8 +11,10 @@ cxx := driver.cxx dom-parse.cxx
obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
dep := $(obj:.o=.o.d)
-driver := $(out_base)/driver
-clean := $(out_base)/.clean
+driver := $(out_base)/driver
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Import.
@@ -21,9 +23,11 @@ $(call import,\
$(scf_root)/import/libxerces-c/stub.make,\
l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
+ifeq ($(filter $(MAKECMDGOALS),dist dist-win),)
$(call import,\
$(scf_root)/import/libxqilla/stub.make,\
l: xqilla.l,cpp-options: xqilla.l.cpp-options)
+endif
# Build.
@@ -47,6 +51,26 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+$(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
+
+$(dist-common):
+ $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/driver-2.cxx,$(dist_prefix)/$(path)/driver-2.cxx)
+ $(call install-data,$(src_base)/people.xsd,$(dist_prefix)/$(path)/people.xsd)
+ $(call install-data,$(src_base)/people.xml,$(dist_prefix)/$(path)/people.xml)
+ $(call install-data,$(src_base)/dom-parse.hxx,$(dist_prefix)/$(path)/dom-parse.hxx)
+ $(call install-data,$(src_base)/dom-parse.cxx,$(dist_prefix)/$(path)/dom-parse.cxx)
+
+$(dist): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
+
+$(dist-win): $(dist-common)
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
+ $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
@@ -74,6 +98,7 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(bld_root)/install.make)
$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
# Dependencies.
diff --git a/examples/makefile b/examples/makefile
index fcc4e71..66fdde2 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -5,12 +5,14 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
-default := $(out_base)/
-clean := $(out_base)/.clean
-
-.PHONY: $(default) $(clean)
+default := $(out_base)/
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
$(default): $(out_base)/cxx/parser/ $(out_base)/cxx/tree/
+$(dist): $(out_base)/cxx/parser/.dist $(out_base)/cxx/tree/.dist
+$(dist-win): $(out_base)/cxx/parser/.dist-win $(out_base)/cxx/tree/.dist-win
$(clean): $(out_base)/cxx/parser/.clean $(out_base)/cxx/tree/.clean
$(call import,$(src_base)/cxx/parser/makefile)