From 15cd227d73b492b4992d9cea6d26015449f59c93 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 6 Sep 2010 14:20:19 +0200 Subject: Generate config.h --- odb/details/config.hxx | 9 ++++----- odb/makefile | 23 ++++++++++++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'odb') diff --git a/odb/details/config.hxx b/odb/details/config.hxx index c5b97df..8237d88 100644 --- a/odb/details/config.hxx +++ b/odb/details/config.hxx @@ -10,12 +10,11 @@ #ifdef _MSC_VER # include +#elif defined(ODB_COMPILER) +# define ODB_THREADS_NONE +# define LIBODB_STATIC_LIB #else -# ifdef HAVE_CONFIG_H -# include -# else -# define ODB_THREADS_POSIX -# endif +# include #endif // no post diff --git a/odb/makefile b/odb/makefile index 0fb038d..6f459a6 100644 --- a/odb/makefile +++ b/odb/makefile @@ -51,11 +51,21 @@ clean := $(out_base)/.clean # $(odb.l): $(cxx_obj) -lpthread -$(cxx_obj) $(cxx_od): $(odb.l.cpp-options) +$(cxx_obj) $(cxx_od): $(odb.l.cpp-options) $(out_base)/details/config.h $(odb.l.cpp-options): value := -I$(out_root) -I$(src_root) $(call include-dep,$(cxx_od)) +$(out_base)/details/config.h: + @echo '// file : odb/details/config.h' >$@ + @echo '// author : automatically generated' >>$@ + @echo '' >>$@ + @echo '#ifndef ODB_DETAILS_CONFIG_H' >>$@ + @echo '#define ODB_DETAILS_CONFIG_H' >>$@ + @echo '' >>$@ + @echo '#define ODB_THREADS_POSIX 1' >>$@ + @echo '' >>$@ + @echo '#endif // ODB_DETAILS_CONFIG_H' >>$@ # Convenience alias for default target. # @@ -97,7 +107,18 @@ $(clean): $(odb.l).o.clean \ $(odb.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.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. # -- cgit v1.1