aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/makefile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-06 14:23:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-06 14:23:23 +0200
commit5737a46a761a6af5d47b2ae68e264d30836adb9a (patch)
treecd767594f100f7af7e94a1cafe6abc46a50bd889 /odb/mysql/makefile
parent404ef5ab95820f49df26b5b41ecec0db83105e17 (diff)
Generate config.h
Diffstat (limited to 'odb/mysql/makefile')
-rw-r--r--odb/mysql/makefile27
1 files changed, 25 insertions, 2 deletions
diff --git a/odb/mysql/makefile b/odb/mysql/makefile
index 94495ac..8fe0c24 100644
--- a/odb/mysql/makefile
+++ b/odb/mysql/makefile
@@ -44,13 +44,24 @@ $(call import,\
# Build.
#
$(odb_mysql.l): $(cxx_obj) $(odb.l) $(mysql.l)
-$(odb_mysql.l.cpp-options): value := -I$(src_root)
+$(odb_mysql.l.cpp-options): value := -I$(out_root) -I$(src_root)
$(odb_mysql.l.cpp-options): $(odb.l.cpp-options) $(mysql.l.cpp-options)
-$(cxx_obj) $(cxx_od): $(odb_mysql.l.cpp-options)
+$(cxx_obj) $(cxx_od): $(odb_mysql.l.cpp-options) $(out_base)/details/config.h
$(call include-dep,$(cxx_od))
+$(out_base)/details/config.h:
+ @echo '// file : odb/mysql/details/config.h' >$@
+ @echo '// author : automatically generated' >>$@
+ @echo '' >>$@
+ @echo '#ifndef ODB_MYSQL_DETAILS_CONFIG_H' >>$@
+ @echo '#define ODB_MYSQL_DETAILS_CONFIG_H' >>$@
+ @echo '' >>$@
+ @echo '#define LIBODB_MYSQL_INCLUDE_LONG 1' >>$@
+ @echo '' >>$@
+ @echo '#endif // ODB_MYSQL_DETAILS_CONFIG_H' >>$@
+
# Convenience alias for default target.
#
$(out_base)/: $(odb_mysql.l)
@@ -77,6 +88,18 @@ $(clean): $(odb_mysql.l).o.clean \
$(odb_mysql.l.cpp-options).clean \
$(addsuffix .cxx.clean,$(cxx_obj)) \
$(addsuffix .cxx.clean,$(cxx_od))
+ $(call message,rm $$1,rm -f $$1,$(out_base)/details/config.h)
+
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(odb_mysql.l): | $(out_base)/.gitignore
+
+$(out_base)/.gitignore: files := details/config.h
+$(clean): $(out_base)/.gitignore.clean
+
+$(call include,$(bld_root)/git/gitignore.make)
+endif
# How to.
#