aboutsummaryrefslogtreecommitdiff
path: root/odb/makefile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-06 14:20:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-06 14:20:19 +0200
commit15cd227d73b492b4992d9cea6d26015449f59c93 (patch)
tree4665257339f76af8aaa3f617b2622ca2df2264aa /odb/makefile
parent0e2ae18a97fd507bac872031888d34c3a7d8b17b (diff)
Generate config.h
Diffstat (limited to 'odb/makefile')
-rw-r--r--odb/makefile23
1 files changed, 22 insertions, 1 deletions
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.
#