From 98ce3d9f82847932f974b10841ccb77b3cba838f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 11 Oct 2009 18:35:19 +0200 Subject: Add install target --- examples/features/makefile | 9 +++++++++ examples/hello/makefile | 9 +++++++++ examples/makefile | 5 +++-- 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'examples') 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)) -- cgit v1.1