aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-03-02 12:14:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-03-02 12:14:54 +0200
commit6c63b913179127e09ed7d9da8920493ccceec6ce (patch)
tree95684b51b4ab60e6468a592a53e33c2cf00027ab /examples
parent3fd3cfc36784be43f545f2f0973e3dc58f475996 (diff)
Add make support for creating binary distributions
Two new make targets, dist and dist-win, were added that allow one to create a binary distribution from the current build. The dist target creates a UNIX distribution while dist-win -- Windows. The simplified build systems for the runtime library and examples that were kept separately are now part of the project (the dist/ subdirectory).
Diffstat (limited to 'examples')
-rw-r--r--examples/cxx/hybrid/compositors/makefile27
-rw-r--r--examples/cxx/hybrid/filter/makefile32
-rw-r--r--examples/cxx/hybrid/hello/makefile29
-rw-r--r--examples/cxx/hybrid/library/makefile28
-rw-r--r--examples/cxx/hybrid/makefile41
-rw-r--r--examples/cxx/hybrid/minimal/makefile28
-rw-r--r--examples/cxx/hybrid/multiroot/makefile30
-rw-r--r--examples/cxx/hybrid/streaming/makefile32
-rw-r--r--examples/cxx/hybrid/wildcard/makefile34
-rw-r--r--examples/cxx/makefile22
-rw-r--r--examples/cxx/parser/generated/makefile25
-rw-r--r--examples/cxx/parser/hello/makefile28
-rw-r--r--examples/cxx/parser/library/makefile34
-rw-r--r--examples/cxx/parser/makefile46
-rw-r--r--examples/cxx/parser/minimal/makefile32
-rw-r--r--examples/cxx/parser/mixed/makefile30
-rw-r--r--examples/cxx/parser/multiroot/makefile36
-rw-r--r--examples/cxx/parser/polymorphism/makefile32
-rw-r--r--examples/cxx/parser/polyroot/makefile34
-rw-r--r--examples/cxx/parser/wildcard/makefile28
-rw-r--r--examples/cxx/serializer/hello/makefile27
-rw-r--r--examples/cxx/serializer/library/makefile33
-rw-r--r--examples/cxx/serializer/makefile43
-rw-r--r--examples/cxx/serializer/minimal/makefile31
-rw-r--r--examples/cxx/serializer/polymorphism/makefile33
-rw-r--r--examples/cxx/serializer/polyroot/makefile33
-rw-r--r--examples/cxx/serializer/wildcard/makefile29
-rw-r--r--examples/makefile12
28 files changed, 776 insertions, 93 deletions
diff --git a/examples/cxx/hybrid/compositors/makefile b/examples/cxx/hybrid/compositors/makefile
index e436db2..f1694ab 100644
--- a/examples/cxx/hybrid/compositors/makefile
+++ b/examples/cxx/hybrid/compositors/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -38,6 +40,26 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)/compositors.xsd,$(dist_prefix)/$(path)/compositors.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.
#
.PHONY: $(clean)
@@ -66,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/filter/makefile b/examples/cxx/hybrid/filter/makefile
index 92adbb1..543d175 100644
--- a/examples/cxx/hybrid/filter/makefile
+++ b/examples/cxx/hybrid/filter/makefile
@@ -21,8 +21,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -53,6 +55,31 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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-custom-pimpl.hxx,$(dist_prefix)/$(path)/people-custom-pimpl.hxx)
+ $(call install-data,$(src_base)/people-custom-pimpl.cxx,$(dist_prefix)/$(path)/people-custom-pimpl.cxx)
+ $(call install-data,$(src_base)/people-custom-simpl.hxx,$(dist_prefix)/$(path)/people-custom-simpl.hxx)
+ $(call install-data,$(src_base)/people-custom-simpl.cxx,$(dist_prefix)/$(path)/people-custom-simpl.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)
+
+$(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.
#
.PHONY: $(clean)
@@ -81,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/hello/makefile b/examples/cxx/hybrid/hello/makefile
index 28db77c..c48ef90 100644
--- a/examples/cxx/hybrid/hello/makefile
+++ b/examples/cxx/hybrid/hello/makefile
@@ -19,8 +19,11 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
+
# Build.
#
@@ -45,6 +48,27 @@ $(call include-dep,$(dep))
.PHONY: $(out_base)/
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.
#
.PHONY: $(clean)
@@ -73,6 +97,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/library/makefile b/examples/cxx/hybrid/library/makefile
index 24f8bf1..f0dbae1 100644
--- a/examples/cxx/hybrid/library/makefile
+++ b/examples/cxx/hybrid/library/makefile
@@ -21,8 +21,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -51,6 +53,27 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.
#
.PHONY: $(clean)
@@ -79,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/makefile b/examples/cxx/hybrid/makefile
index d3f0729..765c196 100644
--- a/examples/cxx/hybrid/makefile
+++ b/examples/cxx/hybrid/makefile
@@ -5,15 +5,18 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
-examples := compositors
+all_examples := compositors hello multiroot streaming library wildcard \
+filter minimal
+
+build_examples := compositors
ifeq ($(xsde_iostream),y)
ifeq ($(xsde_exceptions),y)
-examples += hello multiroot streaming
+build_examples += hello multiroot streaming
ifeq ($(xsde_stl),y)
-examples += library wildcard filter
+build_examples += library wildcard filter
endif
endif
@@ -21,16 +24,34 @@ endif
ifeq ($(xsde_stl),n)
ifeq ($(xsde_exceptions),n)
-examples += minimal
+build_examples += minimal
endif
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) $(dist) $(dist-win) $(clean)
+
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
-.PHONY: $(default) $(clean)
+# Dist.
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
+$(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)
+
+
+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/hybrid/minimal/makefile b/examples/cxx/hybrid/minimal/makefile
index e61b29a..967ab6c 100644
--- a/examples/cxx/hybrid/minimal/makefile
+++ b/examples/cxx/hybrid/minimal/makefile
@@ -21,8 +21,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -51,6 +53,27 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)
+
+$(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.
#
.PHONY: $(clean)
@@ -79,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/multiroot/makefile b/examples/cxx/hybrid/multiroot/makefile
index d4b8cac..e3e24c6 100644
--- a/examples/cxx/hybrid/multiroot/makefile
+++ b/examples/cxx/hybrid/multiroot/makefile
@@ -19,8 +19,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -47,6 +49,29 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)
+
+$(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.
#
.PHONY: $(clean)
@@ -75,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/streaming/makefile b/examples/cxx/hybrid/streaming/makefile
index 86818b9..05d5510 100644
--- a/examples/cxx/hybrid/streaming/makefile
+++ b/examples/cxx/hybrid/streaming/makefile
@@ -21,8 +21,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -52,6 +54,31 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)/object-pimpl.hxx,$(dist_prefix)/$(path)/object-pimpl.hxx)
+ $(call install-data,$(src_base)/object-pimpl.cxx,$(dist_prefix)/$(path)/object-pimpl.cxx)
+ $(call install-data,$(src_base)/object-simpl.hxx,$(dist_prefix)/$(path)/object-simpl.hxx)
+ $(call install-data,$(src_base)/object-simpl.cxx,$(dist_prefix)/$(path)/object-simpl.cxx)
+ $(call install-data,$(src_base)/position.xsd,$(dist_prefix)/$(path)/position.xsd)
+ $(call install-data,$(src_base)/position.xml,$(dist_prefix)/$(path)/position.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.
#
.PHONY: $(clean)
@@ -80,6 +107,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/hybrid/wildcard/makefile b/examples/cxx/hybrid/wildcard/makefile
index 5628406..4268dbf 100644
--- a/examples/cxx/hybrid/wildcard/makefile
+++ b/examples/cxx/hybrid/wildcard/makefile
@@ -21,8 +21,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
#
@@ -53,6 +55,33 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)/body.hxx,$(dist_prefix)/$(path)/body.hxx)
+ $(call install-data,$(src_base)/body.cxx,$(dist_prefix)/$(path)/body.cxx)
+ $(call install-data,$(src_base)/envelope-pimpl.hxx,$(dist_prefix)/$(path)/envelope-pimpl.hxx)
+ $(call install-data,$(src_base)/envelope-pimpl.cxx,$(dist_prefix)/$(path)/envelope-pimpl.cxx)
+ $(call install-data,$(src_base)/envelope-simpl.hxx,$(dist_prefix)/$(path)/envelope-simpl.hxx)
+ $(call install-data,$(src_base)/envelope-simpl.cxx,$(dist_prefix)/$(path)/envelope-simpl.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.
#
.PHONY: $(clean)
@@ -81,6 +110,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)/xsde/hybrid/xsd-cxx.make)
diff --git a/examples/cxx/makefile b/examples/cxx/makefile
index 8b4a552..c1014a6 100644
--- a/examples/cxx/makefile
+++ b/examples/cxx/makefile
@@ -5,16 +5,20 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
-examples := hybrid parser serializer
+mappings := hybrid parser serializer
-default := $(out_base)/
-test := $(out_base)/.test
-clean := $(out_base)/.clean
+default := $(out_base)/
+test := $(out_base)/.test
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
-.PHONY: $(default) $(test) $(clean)
+.PHONY: $(default) $(test) $(dist) $(dist-win) $(clean)
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(mappings)))
+$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(mappings)))
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(mappings)))
+$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(mappings)))
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(mappings)))
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
+$(foreach m,$(mappings),$(call import,$(src_base)/$m/makefile))
diff --git a/examples/cxx/parser/generated/makefile b/examples/cxx/parser/generated/makefile
index 14c039c..3dc9c97 100644
--- a/examples/cxx/parser/generated/makefile
+++ b/examples/cxx/parser/generated/makefile
@@ -14,7 +14,9 @@ xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
driver := $(out_base)/$(xsd:.xsd=-pdriver)
-clean := $(out_base)/.clean
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
# Build.
@@ -42,6 +44,26 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.
#
.PHONY: $(clean)
@@ -72,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)
xsd_pimpl_suffix := -pimpl
$(call include,$(scf_root)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/hello/makefile b/examples/cxx/parser/hello/makefile
index 7f39cd3..b40fb0c 100644
--- a/examples/cxx/parser/hello/makefile
+++ b/examples/cxx/parser/hello/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -39,6 +41,27 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.
#
.PHONY: $(clean)
@@ -67,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/library/makefile b/examples/cxx/parser/library/makefile
index 6cf3f2b..e093cf8 100644
--- a/examples/cxx/parser/library/makefile
+++ b/examples/cxx/parser/library/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -47,6 +49,33 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/library.hxx)
+ $(call install-data,$(src_base)/library-pimpl-mixin.hxx,$(dist_prefix)/$(path)/library-pimpl-mixin.hxx)
+ $(call install-data,$(src_base)/library-pimpl-mixin.cxx,$(dist_prefix)/$(path)/library-pimpl-mixin.cxx)
+ $(call install-data,$(src_base)/library-pimpl-tiein.hxx,$(dist_prefix)/$(path)/library-pimpl-tiein.hxx)
+ $(call install-data,$(src_base)/library-pimpl-tiein.cxx,$(dist_prefix)/$(path)/library-pimpl-tiein.cxx)
+ $(call install-data,$(src_base)/library.map,$(dist_prefix)/$(path)/library.map)
+ $(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.
#
.PHONY: $(clean)
@@ -75,6 +104,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/makefile b/examples/cxx/parser/makefile
index 5a81a72..92e00ce 100644
--- a/examples/cxx/parser/makefile
+++ b/examples/cxx/parser/makefile
@@ -5,29 +5,32 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
-examples :=
+all_examples := generated hello library multiroot polymorphism polyroot \
+mixed wildcard minimal
+
+build_examples :=
ifneq ($(xsde_reuse_style),none)
-examples += generated
+build_examples += generated
endif
ifeq ($(xsde_stl),y)
ifeq ($(xsde_iostream),y)
ifeq ($(xsde_exceptions),y)
-examples += hello
+build_examples += hello
ifneq ($(xsde_reuse_style),none)
-examples += library multiroot
+build_examples += library multiroot
ifeq ($(xsde_polymorphic),y)
-examples += polymorphism polyroot
+build_examples += polymorphism polyroot
endif
endif
ifeq ($(xsde_reuse_style),tiein)
-examples += mixed wildcard
+build_examples += mixed wildcard
endif
endif
@@ -37,17 +40,34 @@ endif
ifeq ($(xsde_stl),n)
ifeq ($(xsde_exceptions),n)
ifneq ($(xsde_reuse_style),none)
-examples += minimal
+build_examples += minimal
endif
endif
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) $(dist) $(dist-win) $(clean)
+
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
-.PHONY: $(default) $(clean)
+# Dist.
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
+$(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)
+
+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/parser/minimal/makefile b/examples/cxx/parser/minimal/makefile
index 7a1eb8f..c0dfda1 100644
--- a/examples/cxx/parser/minimal/makefile
+++ b/examples/cxx/parser/minimal/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -41,6 +43,31 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)/gender.hxx,$(dist_prefix)/$(path)/gender.hxx)
+ $(call install-data,$(src_base)/people-pimpl-mixin.hxx,$(dist_prefix)/$(path)/people-pimpl-mixin.hxx)
+ $(call install-data,$(src_base)/people-pimpl-tiein.hxx,$(dist_prefix)/$(path)/people-pimpl-tiein.hxx)
+ $(call install-data,$(src_base)/people.map,$(dist_prefix)/$(path)/people.map)
+ $(call install-data,$(src_base)/people.xsd,$(dist_prefix)/$(path)/people.xsd)
+ $(call install-data,$(src_base)/people.xml,$(dist_prefix)/$(path)/people.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.
#
.PHONY: $(clean)
@@ -69,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/mixed/makefile b/examples/cxx/parser/mixed/makefile
index 5fa42f1..52072ab 100644
--- a/examples/cxx/parser/mixed/makefile
+++ b/examples/cxx/parser/mixed/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -41,6 +43,29 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)/anchor.hxx,$(dist_prefix)/$(path)/anchor.hxx)
+ $(call install-data,$(src_base)/text.map,$(dist_prefix)/$(path)/text.map)
+ $(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.
#
.PHONY: $(clean)
@@ -69,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/multiroot/makefile b/examples/cxx/parser/multiroot/makefile
index 92c53b6..f3f2e7a 100644
--- a/examples/cxx/parser/multiroot/makefile
+++ b/examples/cxx/parser/multiroot/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -46,6 +48,35 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/protocol.hxx)
+ $(call install-data,$(src_base)/protocol-pimpl-mixin.hxx,$(dist_prefix)/$(path)/protocol-pimpl-mixin.hxx)
+ $(call install-data,$(src_base)/protocol-pimpl-mixin.cxx,$(dist_prefix)/$(path)/protocol-pimpl-mixin.cxx)
+ $(call install-data,$(src_base)/protocol-pimpl-tiein.hxx,$(dist_prefix)/$(path)/protocol-pimpl-tiein.hxx)
+ $(call install-data,$(src_base)/protocol-pimpl-tiein.cxx,$(dist_prefix)/$(path)/protocol-pimpl-tiein.cxx)
+ $(call install-data,$(src_base)/protocol.map,$(dist_prefix)/$(path)/protocol.map)
+ $(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)
+
+$(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.
#
.PHONY: $(clean)
@@ -74,6 +105,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/polymorphism/makefile b/examples/cxx/parser/polymorphism/makefile
index a8f5167..764d69d 100644
--- a/examples/cxx/parser/polymorphism/makefile
+++ b/examples/cxx/parser/polymorphism/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -46,6 +48,31 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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-pimpl-mixin.hxx,$(dist_prefix)/$(path)/supermen-pimpl-mixin.hxx)
+ $(call install-data,$(src_base)/supermen-pimpl-mixin.cxx,$(dist_prefix)/$(path)/supermen-pimpl-mixin.cxx)
+ $(call install-data,$(src_base)/supermen-pimpl-tiein.hxx,$(dist_prefix)/$(path)/supermen-pimpl-tiein.hxx)
+ $(call install-data,$(src_base)/supermen-pimpl-tiein.cxx,$(dist_prefix)/$(path)/supermen-pimpl-tiein.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.
#
.PHONY: $(clean)
@@ -74,6 +101,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/polyroot/makefile b/examples/cxx/parser/polyroot/makefile
index 2a72c3a..7de4341 100644
--- a/examples/cxx/parser/polyroot/makefile
+++ b/examples/cxx/parser/polyroot/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -46,6 +48,33 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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-pimpl-mixin.hxx,$(dist_prefix)/$(path)/supermen-pimpl-mixin.hxx)
+ $(call install-data,$(src_base)/supermen-pimpl-mixin.cxx,$(dist_prefix)/$(path)/supermen-pimpl-mixin.cxx)
+ $(call install-data,$(src_base)/supermen-pimpl-tiein.hxx,$(dist_prefix)/$(path)/supermen-pimpl-tiein.hxx)
+ $(call install-data,$(src_base)/supermen-pimpl-tiein.cxx,$(dist_prefix)/$(path)/supermen-pimpl-tiein.cxx)
+ $(call install-data,$(src_base)/supermen.xsd,$(dist_prefix)/$(path)/supermen.xsd)
+ $(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)/batman.xml,$(dist_prefix)/$(path)/batman.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.
#
.PHONY: $(clean)
@@ -74,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/parser/wildcard/makefile b/examples/cxx/parser/wildcard/makefile
index c07b11b..166c403 100644
--- a/examples/cxx/parser/wildcard/makefile
+++ b/examples/cxx/parser/wildcard/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -39,6 +41,27 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.
#
.PHONY: $(clean)
@@ -67,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)/xsde/parser/xsd-cxx.make)
diff --git a/examples/cxx/serializer/hello/makefile b/examples/cxx/serializer/hello/makefile
index 77e9ad8..5d07a2d 100644
--- a/examples/cxx/serializer/hello/makefile
+++ b/examples/cxx/serializer/hello/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -39,6 +41,26 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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)
+
+$(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.
#
.PHONY: $(clean)
@@ -67,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)/xsde/serializer/xsd-cxx.make)
diff --git a/examples/cxx/serializer/library/makefile b/examples/cxx/serializer/library/makefile
index e44c671..5ca18fb 100644
--- a/examples/cxx/serializer/library/makefile
+++ b/examples/cxx/serializer/library/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -47,6 +49,32 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/library.hxx)
+ $(call install-data,$(src_base)/library-simpl-mixin.hxx,$(dist_prefix)/$(path)/library-simpl-mixin.hxx)
+ $(call install-data,$(src_base)/library-simpl-mixin.cxx,$(dist_prefix)/$(path)/library-simpl-mixin.cxx)
+ $(call install-data,$(src_base)/library-simpl-tiein.hxx,$(dist_prefix)/$(path)/library-simpl-tiein.hxx)
+ $(call install-data,$(src_base)/library-simpl-tiein.cxx,$(dist_prefix)/$(path)/library-simpl-tiein.cxx)
+ $(call install-data,$(src_base)/library.map,$(dist_prefix)/$(path)/library.map)
+ $(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.
#
.PHONY: $(clean)
@@ -75,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)/xsde/serializer/xsd-cxx.make)
diff --git a/examples/cxx/serializer/makefile b/examples/cxx/serializer/makefile
index 0bda4e8..7e454bf 100644
--- a/examples/cxx/serializer/makefile
+++ b/examples/cxx/serializer/makefile
@@ -5,25 +5,27 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
-examples :=
+all_examples := hello library polymorphism polyroot wildcard minimal
+
+build_examples :=
ifeq ($(xsde_stl),y)
ifeq ($(xsde_iostream),y)
ifeq ($(xsde_exceptions),y)
-examples += hello
+build_examples += hello
ifneq ($(xsde_reuse_style),none)
-examples += library
+build_examples += library
ifeq ($(xsde_polymorphic),y)
-examples += polymorphism polyroot
+build_examples += polymorphism polyroot
endif
endif
ifeq ($(xsde_reuse_style),tiein)
-examples += wildcard
+build_examples += wildcard
endif
endif
@@ -33,17 +35,34 @@ endif
ifeq ($(xsde_stl),n)
ifeq ($(xsde_exceptions),n)
ifneq ($(xsde_reuse_style),none)
-examples += minimal
+build_examples += minimal
endif
endif
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) $(dist) $(dist-win) $(clean)
+
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
-.PHONY: $(default) $(clean)
+# Dist.
+#
+$(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
+ $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))
+$(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)
+
+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/serializer/minimal/makefile b/examples/cxx/serializer/minimal/makefile
index 4bd42a1..992343e 100644
--- a/examples/cxx/serializer/minimal/makefile
+++ b/examples/cxx/serializer/minimal/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -41,6 +43,30 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/people.hxx)
+ $(call install-data,$(src_base)/people-simpl-mixin.hxx,$(dist_prefix)/$(path)/people-simpl-mixin.hxx)
+ $(call install-data,$(src_base)/people-simpl-tiein.hxx,$(dist_prefix)/$(path)/people-simpl-tiein.hxx)
+ $(call install-data,$(src_base)/people.map,$(dist_prefix)/$(path)/people.map)
+ $(call install-data,$(src_base)/people.xsd,$(dist_prefix)/$(path)/people.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.
#
.PHONY: $(clean)
@@ -69,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)/xsde/serializer/xsd-cxx.make)
diff --git a/examples/cxx/serializer/polymorphism/makefile b/examples/cxx/serializer/polymorphism/makefile
index 24845cb..203ca26 100644
--- a/examples/cxx/serializer/polymorphism/makefile
+++ b/examples/cxx/serializer/polymorphism/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -48,6 +50,32 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/supermen.hxx)
+ $(call install-data,$(src_base)/supermen-simpl-mixin.hxx,$(dist_prefix)/$(path)/supermen-simpl-mixin.hxx)
+ $(call install-data,$(src_base)/supermen-simpl-mixin.cxx,$(dist_prefix)/$(path)/supermen-simpl-mixin.cxx)
+ $(call install-data,$(src_base)/supermen-simpl-tiein.hxx,$(dist_prefix)/$(path)/supermen-simpl-tiein.hxx)
+ $(call install-data,$(src_base)/supermen-simpl-tiein.cxx,$(dist_prefix)/$(path)/supermen-simpl-tiein.cxx)
+ $(call install-data,$(src_base)/supermen.map,$(dist_prefix)/$(path)/supermen.map)
+ $(call install-data,$(src_base)/supermen.xsd,$(dist_prefix)/$(path)/supermen.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.
#
.PHONY: $(clean)
@@ -76,6 +104,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)/xsde/serializer/xsd-cxx.make)
diff --git a/examples/cxx/serializer/polyroot/makefile b/examples/cxx/serializer/polyroot/makefile
index afa52b5..d151cc4 100644
--- a/examples/cxx/serializer/polyroot/makefile
+++ b/examples/cxx/serializer/polyroot/makefile
@@ -20,8 +20,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -48,6 +50,32 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/supermen.hxx)
+ $(call install-data,$(src_base)/supermen-simpl-mixin.hxx,$(dist_prefix)/$(path)/supermen-simpl-mixin.hxx)
+ $(call install-data,$(src_base)/supermen-simpl-mixin.cxx,$(dist_prefix)/$(path)/supermen-simpl-mixin.cxx)
+ $(call install-data,$(src_base)/supermen-simpl-tiein.hxx,$(dist_prefix)/$(path)/supermen-simpl-tiein.hxx)
+ $(call install-data,$(src_base)/supermen-simpl-tiein.cxx,$(dist_prefix)/$(path)/supermen-simpl-tiein.cxx)
+ $(call install-data,$(src_base)/supermen.map,$(dist_prefix)/$(path)/supermen.map)
+ $(call install-data,$(src_base)/supermen.xsd,$(dist_prefix)/$(path)/supermen.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.
#
.PHONY: $(clean)
@@ -76,6 +104,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)/xsde/serializer/xsd-cxx.make)
diff --git a/examples/cxx/serializer/wildcard/makefile b/examples/cxx/serializer/wildcard/makefile
index e2b43a6..c44aa8c 100644
--- a/examples/cxx/serializer/wildcard/makefile
+++ b/examples/cxx/serializer/wildcard/makefile
@@ -14,8 +14,10 @@ dep := $(obj:.o=.o.d)
xsde.l := $(out_root)/libxsde/xsde/xsde.l
xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
-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
# Build.
@@ -41,6 +43,28 @@ $(call include-dep,$(dep))
$(out_base)/: $(driver)
+# Dist.
+#
+dist-common := $(out_base)/.dist-common
+
+.PHONY: $(dist) $(dist-win) $(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.hxx,$(dist_prefix)/$(path)/email.hxx)
+ $(call install-data,$(src_base)/email.map,$(dist_prefix)/$(path)/email.map)
+ $(call install-data,$(src_base)/email.xsd,$(dist_prefix)/$(path)/email.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.
#
.PHONY: $(clean)
@@ -69,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)/xsde/serializer/xsd-cxx.make)
diff --git a/examples/makefile b/examples/makefile
index 81cba78..5f63a19 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -7,14 +7,18 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
examples := cxx
-default := $(out_base)/
-test := $(out_base)/.test
-clean := $(out_base)/.clean
+default := $(out_base)/
+test := $(out_base)/.test
+dist := $(out_base)/.dist
+dist-win := $(out_base)/.dist-win
+clean := $(out_base)/.clean
-.PHONY: $(default) $(test) $(clean)
+.PHONY: $(default) $(test) $(dist) $(dist-win) $(clean)
$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(examples)))
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(examples)))
+$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(examples)))
$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))