aboutsummaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-02 22:25:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-02 22:25:48 +0200
commit2088891f11ab7aa3f843239cebe06a2850117b0b (patch)
tree3d80655c14ab4bc8101af4bc56e9ac99105a56d3 /odb
parent4eb47d2965ca832243ed80f4140c34cfbed96863 (diff)
Add automake build system support
Diffstat (limited to 'odb')
-rw-r--r--odb/Makefile.am31
-rw-r--r--odb/makefile25
2 files changed, 52 insertions, 4 deletions
diff --git a/odb/Makefile.am b/odb/Makefile.am
new file mode 100644
index 0000000..e8f2b40
--- /dev/null
+++ b/odb/Makefile.am
@@ -0,0 +1,31 @@
+# file : odb/Makefile.am
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+plugindir = $(bindir)
+
+bin_PROGRAMS = odb
+plugin_LTLIBRARIES = odb.la
+
+AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
+
+EXTRA_DIST = __path__(headers) __path__(extra_dist)
+
+# Plugin.
+#
+odb_la_SOURCES = __path__(plugin_sources) __path__(common_sources)
+odb_la_LDFLAGS = -module -shrext .so -avoid-version
+
+# Remove the .la file from the final install.
+#
+install-data-hook:
+ rm -f $(bindir)/odb.la
+
+# Driver.
+#
+odb_SOURCES = __path__(driver_sources) __path__(common_sources)
+
+# Make sure common sources are compiled differently.
+#
+odb_CXXFLAGS = $(AM_CXXFLAGS)
diff --git a/odb/makefile b/odb/makefile
index 5eb23a1..d8592e4 100644
--- a/odb/makefile
+++ b/odb/makefile
@@ -84,10 +84,9 @@ odb_so := $(out_base)/odb.so
# Dummy library to force driver timestamp update when the plugin DSO
# changes.
#
-odb.l := $(out_base)/odb.l
-
-clean := $(out_base)/.clean
-install := $(out_base)/.install
+odb.l := $(out_base)/odb.l
+clean := $(out_base)/.clean
+dist := $(out_base)/.dist
# Import.
#
@@ -133,6 +132,21 @@ $(install): $(odb)
$(call install-exec,$<,$(install_bin_dir)/odb)
$(call install-exec,$<.so,$(install_bin_dir)/odb.so)
+# Dist.
+#
+$(dist): export plugin_sources := $(cxx_ptun)
+$(dist): export driver_sources := $(cxx_dtun)
+$(dist): export common_sources := $(cxx_ctun) $(cli_tun:.cli=.cxx)
+$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \
+-name '*.hxx' -o -name '*.ixx' -o -name '*.txx'))
+$(dist): data_dist := $(cli_tun)
+$(dist): export extra_dist := $(data_dist)
+
+$(dist): $(gen)
+ $(call dist-data,$(plugin_sources) $(driver_sources) \
+$(common_sources) $(headers) $(data_dist))
+ $(call meta-automake)
+
# Clean.
#
$(clean): \
@@ -159,7 +173,10 @@ endif
# Rules.
#
+$(call include,$(bld_root)/dist.make)
+$(call include,$(bld_root)/meta/automake.make)
$(call include,$(bld_root)/install.make)
+
$(call include,$(cli_rules))
$(call include,$(bld_root)/cxx/cxx-d.make)
$(call include,$(bld_root)/cxx/cxx-o.make)