aboutsummaryrefslogtreecommitdiff
path: root/common/include/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'common/include/makefile')
-rw-r--r--common/include/makefile20
1 files changed, 5 insertions, 15 deletions
diff --git a/common/include/makefile b/common/include/makefile
index eb25d9f..9428c59 100644
--- a/common/include/makefile
+++ b/common/include/makefile
@@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
cxx_tun := driver.cxx
odb_hdr := obj1.hxx obj2.hxx obj3.hxx test1.hxx test2.hxx test3.hxx test4.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,\
@@ -30,9 +27,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) \
-I$(out_base)/../.. -I$(src_base)/../..
$(cxx_obj) $(cxx_od): $(common.l.cpp-options)
-genf := $(foreach f,$(odb_hdr:.hxx=-odb),$(addprefix $f,.hxx .ixx .cxx))
-gen := $(addprefix $(out_base)/,$(genf))
-
$(gen): $(odb)
$(gen): odb := $(odb)
$(gen): odb_options += --database $(db_id) --table-prefix include_
@@ -51,11 +45,7 @@ $(dist):
# Test.
#
-$(test): $(driver) $(src_base)/test.std
- $(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.
#
@@ -63,7 +53,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.