summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cxx/tree/makefile')
-rw-r--r--examples/cxx/tree/makefile44
1 files changed, 34 insertions, 10 deletions
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