From 3c853bc264719437bcb2807d75ff5e9f9a3ea4f8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Sep 2009 14:40:53 +0200 Subject: Add distribution-specific files, dist and dist-win targets --- examples/cxx/tree/makefile | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'examples/cxx/tree/makefile') 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 -- cgit v1.1