aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/parser/mixed/makefile
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/cxx/parser/mixed/makefile
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/cxx/parser/mixed/makefile')
-rw-r--r--examples/cxx/parser/mixed/makefile30
1 files changed, 28 insertions, 2 deletions
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)