summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-10-11 18:35:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-10-11 18:35:19 +0200
commit98ce3d9f82847932f974b10841ccb77b3cba838f (patch)
treeb4987762ea041988d6ba60d5e8c1b08a969bd541 /examples
parentc831e6282726bde7596050be13bc4afbf5d45488 (diff)
Add install target
Diffstat (limited to 'examples')
-rw-r--r--examples/features/makefile9
-rw-r--r--examples/hello/makefile9
-rw-r--r--examples/makefile5
3 files changed, 21 insertions, 2 deletions
diff --git a/examples/features/makefile b/examples/features/makefile
index c599afe..52d5d38 100644
--- a/examples/features/makefile
+++ b/examples/features/makefile
@@ -12,6 +12,7 @@ obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(cli:.cli=.o))
dep := $(obj:.o=.o.d)
driver := $(out_base)/driver
+install := $(out_base)/.install
clean := $(out_base)/.clean
# Build.
@@ -32,6 +33,14 @@ $(call include-dep,$(dep),$(obj),$(gen))
#
$(out_base)/: $(driver)
+# Install
+#
+$(install): path := $(subst $(src_root)/,,$(src_base))
+$(install):
+ $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/cli/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/options.cli,$(install_doc_dir)/cli/$(path)/options.cli)
+ $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/$(path)/README)
+
# Clean.
#
$(clean): $(driver).o.clean \
diff --git a/examples/hello/makefile b/examples/hello/makefile
index f5c191c..49e99b9 100644
--- a/examples/hello/makefile
+++ b/examples/hello/makefile
@@ -12,6 +12,7 @@ obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(cli:.cli=.o))
dep := $(obj:.o=.o.d)
driver := $(out_base)/driver
+install := $(out_base)/.install
clean := $(out_base)/.clean
# Build.
@@ -32,6 +33,14 @@ $(call include-dep,$(dep),$(obj),$(gen))
#
$(out_base)/: $(driver)
+# Install
+#
+$(install): path := $(subst $(src_root)/,,$(src_base))
+$(install):
+ $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/cli/$(path)/driver.cxx)
+ $(call install-data,$(src_base)/hello.cli,$(install_doc_dir)/cli/$(path)/hello.cli)
+ $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/$(path)/README)
+
# Clean.
#
$(clean): $(driver).o.clean \
diff --git a/examples/makefile b/examples/makefile
index 0180e9a..135b9bb 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -8,11 +8,12 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
examples := hello features
default := $(out_base)/
+install := $(out_base)/.install
clean := $(out_base)/.clean
-.PHONY: $(default) $(clean)
-
$(default): $(addprefix $(out_base)/,$(addsuffix /,$(examples)))
+$(install): $(addprefix $(out_base)/,$(addsuffix /.install,$(examples)))
+ $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/examples/README)
$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(examples)))
$(foreach e,$(examples),$(call import,$(src_base)/$e/makefile))