diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-06-04 16:25:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-06-04 16:25:40 +0200 |
commit | 5d7489b226649a6790d1afbb28359ce5f6ec5c6a (patch) | |
tree | c3e9b3357ed2fc36ec152b4fd00a1294d25699d5 /build/hxx | |
parent | 4f17a1e17ca7d40605bf6af46d8136f2c8d30779 (diff) |
Add odb import stub
Diffstat (limited to 'build/hxx')
-rw-r--r-- | build/hxx/hxx-cxx.make | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/build/hxx/hxx-cxx.make b/build/hxx/hxx-cxx.make new file mode 100644 index 0000000..55d32e3 --- /dev/null +++ b/build/hxx/hxx-cxx.make @@ -0,0 +1,56 @@ +# file : build/hxx/hxx-cxx.make +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Get the C++ configuration (file extensions, and extra CPP options). +# +$(call include,$(bld_root)/cxx/configuration.make) + +odb_pattern := \ +$(out_base)/%-odb.$(cxx_s_suffix) \ +$(out_base)/%-odb.$(cxx_h_suffix) \ +$(out_base)/%-odb.$(cxx_i_suffix) \ +$(out_base)/%.sql + +$(odb_pattern): odb := odb +$(odb_pattern): odb_options := \ +--hxx-suffix .$(cxx_h_suffix) \ +--ixx-suffix .$(cxx_i_suffix) \ +--cxx-suffix .$(cxx_s_suffix) + +$(odb_pattern): odb-expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(odb_pattern): odb-expand-cpp-options = \ +$(call odb-expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +.PRECIOUS: $(odb_pattern) + +ifeq ($(out_base),$(src_base)) + +$(odb_pattern): $(src_base)/%.$(cxx_h_suffix) + $(call message,odb $<,$(odb) $(cpp_options) \ +$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +--output-dir $(dir $@) $<) + +else + +$(odb_pattern): $(src_base)/%.$(cxx_h_suffix) | $$(dir $$@). + $(call message,odb $<,$(odb) $(cpp_options) \ +$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +--output-dir $(dir $@) $<) + +$(odb_pattern): $(out_base)/%.$(cxx_h_suffix) | $$(dir $$@). + $(call message,odb $<,$(odb) $(cpp_options) \ +$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +--output-dir $(dir $@) $<) +endif + +.PHONY: $(out_base)/%-odb.cxx.hxx.clean + +$(out_base)/%-odb.cxx.hxx.clean: + $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_s_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_h_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_i_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:-odb.cxx.hxx.clean=.sql)) |