aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-06 14:26:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-06 14:26:25 +0200
commit921c4c14c2999a03b9e649b5c9adec73b5cae0de (patch)
treec3a0015286ded8b59f2f44fd7b22be2748e16098 /makefile
parent0f9123ae095d3da7f2fb55d95af49ec3aa0a9c17 (diff)
Add automake build support
Diffstat (limited to 'makefile')
-rw-r--r--makefile45
1 files changed, 33 insertions, 12 deletions
diff --git a/makefile b/makefile
index e3559a9..aba3aee 100644
--- a/makefile
+++ b/makefile
@@ -1,24 +1,45 @@
-# file : mysql/makefile
+# file : makefile
# author : Boris Kolpackov <boris@codesynthesis.com>
# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
# license : GNU GPL; see accompanying LICENSE file
include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make
-tests := \
-common \
-tracer
+all_dirs := libcommon common tracer mysql
+dirs := common tracer
ifeq ($(db_id),mysql)
-tests += mysql
+dirs += mysql
endif
-default := $(out_base)/
-test := $(out_base)/.test
-clean := $(out_base)/.clean
+default := $(out_base)/
+dist := $(out_base)/.dist
+test := $(out_base)/.test
+clean := $(out_base)/.clean
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests)))
-$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests)))
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs)))
-$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile))
+$(dist): data_dist := GPLv2 LICENSE README version
+$(dist): exec_dist := bootstrap tester.in
+$(dist): export extra_dist := $(data_dist) $(exec_dist)
+$(dist): export version = $(shell cat $(src_root)/version)
+
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs)))
+ $(call dist-data,$(data_dist))
+ $(call dist-exec,$(exec_dist))
+ $(call dist-dir,m4)
+ $(call meta-automake)
+ $(call meta-autoconf)
+
+$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs)))
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs)))
+
+$(call include,$(bld_root)/dist.make)
+$(call include,$(bld_root)/meta/automake.make)
+$(call include,$(bld_root)/meta/autoconf.make)
+
+ifneq ($(filter $(MAKECMDGOALS),dist clean),)
+$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile))
+else
+$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile))
+endif