From d52c1fb406b1cef82c5f5a28fc1804d7d99a49d8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 17 Nov 2016 01:35:29 +0300 Subject: Add support for build2 for tests and examples --- examples/hello/.gitignore | 1 + examples/hello/buildfile | 12 ++++++++ examples/hello/makefile | 72 ----------------------------------------------- 3 files changed, 13 insertions(+), 72 deletions(-) create mode 100644 examples/hello/.gitignore create mode 100644 examples/hello/buildfile delete mode 100644 examples/hello/makefile (limited to 'examples/hello') diff --git a/examples/hello/.gitignore b/examples/hello/.gitignore new file mode 100644 index 0000000..d73130a --- /dev/null +++ b/examples/hello/.gitignore @@ -0,0 +1 @@ +hello.?xx diff --git a/examples/hello/buildfile b/examples/hello/buildfile new file mode 100644 index 0000000..f45001d --- /dev/null +++ b/examples/hello/buildfile @@ -0,0 +1,12 @@ +# file : examples/hello/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{hello} doc{README} +exe{driver}: test.arguments = --greeting Hi John Jane + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{hello}: cli{hello} diff --git a/examples/hello/makefile b/examples/hello/makefile deleted file mode 100644 index cd8d29d..0000000 --- a/examples/hello/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# file : examples/hello/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cli := hello.cli -cxx := driver.cxx - -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. -# -$(driver): $(obj) - -$(obj) $(dep): cpp_options := -I$(out_base) - -genf := $(cli:.cli=.hxx) $(cli:.cli=.ixx) $(cli:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): cli := $(out_root)/cli/cli -$(gen): $(out_root)/cli/cli - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(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 \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) \ - $(addprefix $(out_base)/,$(cli:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(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,$(scf_root)/cli/cli-cxx.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) -- cgit v1.1