From 921c4c14c2999a03b9e649b5c9adec73b5cae0de Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 6 Sep 2010 14:26:25 +0200 Subject: Add automake build support --- makefile | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'makefile') 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 # 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 -- cgit v1.1