From 6c63b913179127e09ed7d9da8920493ccceec6ce Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 Mar 2009 12:14:54 +0200 Subject: 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). --- examples/cxx/parser/makefile | 46 +++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'examples/cxx/parser/makefile') 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 -- cgit v1.1