aboutsummaryrefslogtreecommitdiff
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
parent404ef5ab95820f49df26b5b41ecec0db83105e17 (diff)
Generate config.h
-rw-r--r--odb/mysql/details/config.hxx16
-rw-r--r--odb/mysql/makefile27
2 files changed, 32 insertions, 11 deletions
diff --git a/odb/mysql/details/config.hxx b/odb/mysql/details/config.hxx
index 957f623..30ac531 100644
--- a/odb/mysql/details/config.hxx
+++ b/odb/mysql/details/config.hxx
@@ -8,18 +8,16 @@
// no pre
-#ifdef HAVE_CONFIG_H
+#ifdef _MSC_VER
+# if !defined(LIBODB_MYSQL_INCLUDE_SHORT) && !defined (LIBODB_MYSQL_INCLUDE_LONG)
+# define LIBODB_MYSQL_INCLUDE_SHORT 1
+# endif
+#elif defined(ODB_COMPILER)
+# error libodb-mysql header included in odb-compiled header
+#else
# include <odb/mysql/details/config.h>
#endif
-#if !defined(LIBODB_MYSQL_INCLUDE_SHORT) && !defined (LIBODB_MYSQL_INCLUDE_LONG)
- #ifdef _WIN32
- #define LIBODB_MYSQL_INCLUDE_SHORT 1
- #else
- #define LIBODB_MYSQL_INCLUDE_LONG 1
- #endif
-#endif
-
// no post
#endif // ODB_MYSQL_DETAILS_CONFIG_HXX
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.
#