summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/dbxml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cxx/tree/dbxml')
-rw-r--r--examples/cxx/tree/dbxml/makefile26
1 files changed, 24 insertions, 2 deletions
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.