Configuration fragment
[ntk/apt.git] / buildlib / configure.mak
1 # -*- make -*-
2
3 # This make fragment is included by the toplevel make to handle configure
4 # and setup. It defines a target called startup that when run will init
5 # the build directory, generate configure from configure.in, create aclocal
6 # and has rules to run config.status should one of the .in files change.
7
8 # Input
9 # BUILD - The build director
10 # CONVERTED - List of files output by configure $(BUILD) is prepended
11 # The caller must provide depends for these files
12 # It would be a fairly good idea to run this after a cvs checkout.
13 BUILD=build
14
15 .PHONY: startup
16 startup: configure $(addprefix $(BUILD)/,$(CONVERTED))
17
18 configure: aclocal.m4 configure.in
19 autoconf
20 aclocal.m4:
21 aclocal -I buildlib
22 $(BUILD)/config.status: configure
23 test -e $(BUILD) || mkdir $(BUILD)
24 (HERE=`pwd`; cd $(BUILD) && $$HERE/configure)
25 $(CONVERTED): $(BUILD)/config.status
26 (cd $(BUILD) && ./config.status)
27
28 # We include the environment if it exists and re-export it to configure. This
29 # allows someone to edit it and not have their changes blown away.
30 Env = $(wildcard $(BUILD)/environment.mak)
31 ifneq ($(words $(Env)),0)
32 include $(Env)
33 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS PICFLAGS
34 endif
35