aboutsummaryrefslogtreecommitdiff
path: root/qt/pgsql
diff options
context:
space:
mode:
Diffstat (limited to 'qt/pgsql')
-rw-r--r--qt/pgsql/basic/makefile21
-rw-r--r--qt/pgsql/date-time/makefile21
-rw-r--r--qt/pgsql/makefile5
-rw-r--r--qt/pgsql/template/makefile21
4 files changed, 15 insertions, 53 deletions
diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile
index eaa4fdd..9dea1b1 100644
--- a/qt/pgsql/basic/makefile
+++ b/qt/pgsql/basic/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_qt.l.cpp-options) \
$(qt_core.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 qt/basic \
@@ -79,12 +73,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.
#
@@ -92,7 +81,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/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile
index 8c75ef3..46bccbb 100644
--- a/qt/pgsql/date-time/makefile
+++ b/qt/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,\
@@ -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_qt.l.cpp-options) \
$(qt_core.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 qt/date-time \
@@ -79,12 +73,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.
#
@@ -92,7 +81,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/qt/pgsql/makefile b/qt/pgsql/makefile
index fb89608..70df91b 100644
--- a/qt/pgsql/makefile
+++ b/qt/pgsql/makefile
@@ -9,11 +9,6 @@ basic \
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 := qt-pgsql
diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile
index 8ffa434..9a1e72f 100644
--- a/qt/pgsql/template/makefile
+++ b/qt/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,\
@@ -33,9 +30,6 @@ $(driver): $(cxx_obj) $(odb_qt.l) $(common.l)
$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base)
$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 qt \
@@ -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.