From 6cd8b9f561b912f264ba4f723845935c40a3cb95 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Jun 2013 10:39:59 +0200 Subject: Add support for running tests in dynamic multi-database mode Only possible in the development build system at this stage. --- boost/common/makefile | 10 +++++----- boost/common/multi-index/makefile | 29 +++++++++++++---------------- boost/common/optional/makefile | 29 +++++++++++++---------------- boost/common/smart-ptr/makefile | 29 +++++++++++++---------------- boost/common/template/makefile | 29 +++++++++++++---------------- boost/common/unordered/makefile | 29 +++++++++++++---------------- boost/common/uuid/makefile | 29 +++++++++++++---------------- boost/makefile | 15 ++++++++++----- boost/mssql/date-time/makefile | 21 +++++---------------- boost/mssql/makefile | 5 ----- boost/mssql/template/makefile | 21 +++++---------------- boost/mysql/date-time/makefile | 21 +++++---------------- boost/mysql/makefile | 5 ----- boost/mysql/template/makefile | 21 +++++---------------- boost/oracle/date-time/makefile | 21 +++++---------------- boost/oracle/makefile | 5 ----- boost/oracle/template/makefile | 21 +++++---------------- boost/pgsql/date-time/makefile | 21 +++++---------------- boost/pgsql/makefile | 5 ----- boost/pgsql/template/makefile | 21 +++++---------------- boost/sqlite/date-time/makefile | 21 +++++---------------- boost/sqlite/makefile | 5 ----- boost/sqlite/template/makefile | 21 +++++---------------- 23 files changed, 143 insertions(+), 291 deletions(-) (limited to 'boost') diff --git a/boost/common/makefile b/boost/common/makefile index 266d9b9..4c81d25 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -15,11 +15,6 @@ uuid all_tests := $(tests) build_tests := $(tests) -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := boost-common @@ -35,6 +30,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(tests)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index fabf4b7..2aa5651 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 5502501..e29b486 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema --generate-query \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 4574160..f41eb40 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema --generate-session \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/template/makefile b/boost/common/template/makefile index ee924b1..881ac76 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 88cad51..0ed08d8 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index dbb3016..3498175 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema --generate-query \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/makefile b/boost/makefile index 264655a..ff5f003 100644 --- a/boost/makefile +++ b/boost/makefile @@ -6,12 +6,12 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make all_dirs := common mysql sqlite pgsql oracle mssql dirs := common -dirs += $(db_id) -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +# Database-specific tests are not run in the multi-database configuration. +# +ifneq ($(db_id),common) +dirs += $(db_id) +endif $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) @@ -21,6 +21,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(call meta-automake) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) $(call include,$(bld_root)/dist.make) diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index f7ce059..cc9dff1 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mssql \ @@ -78,12 +72,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -91,7 +80,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 81c0ebb..6751f63 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mssql diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index fa9149c..6c472e0 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mssql --profile boost \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 401e5cc..aaff422 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost/date-time \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 069d6e0..748c54a 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mysql diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 33b2440..5ca6481 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 9c804c0..0b386ca 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database oracle \ @@ -78,12 +72,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -91,7 +80,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 3294e24..e7e72ab 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-oracle diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index ca488c0..18e3307 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database oracle --profile boost \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index a899d40..5915e53 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile boost/date-time \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 94e993f..4834247 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-pgsql diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 1c63146..5423cbc 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile boost \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 732cb09..8f4e620 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile boost/date-time \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index e76501d..c0a26f5 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-sqlite diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 77500d2..b6b1fb0 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile boost \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ ->$(out_base)/test.out) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. -- cgit v1.1