3 # If usescons=something then reroute to scons if user is using that.
6 SCONS_USER = $(wildcard $(depth)/.sconsign)
8 SCONS_USER = $(wildcard $(depth)/.sconf_temp)
10 ifneq ($(SCONS_USER),)
12 ifeq ($(strip $(depth)),..)
13 here = $(notdir $(CURDIR))
15 ifeq ($(strip $(depth)),../..)
17 # here = $(notdir $(dir $(CURDIR)))/$(notdir $(CURDIR))
18 here = $(shell basename $$(dirname $(CURDIR)))/$(notdir $(CURDIR))
22 MAKE_TARGETS = config deb diff dist distclean doc release po \
23 po-replace po-update all clean check default exe help install lib web \
24 web-install web-clean TAGS
26 $(MAKE_TARGETS): scons
28 # To make this trickery complete, we could have ./configure remove
29 # traces of scons configuration.
31 @echo "warning: $(SCONS_USER) detected, rerouting to scons"
32 cd $(depth) && scons $(here) $(MAKECMDGOALS)
38 # Use alternate configurations alongside eachother:
40 # ./configure --enable-config=debug
43 # uses config-debug.make and config-debug.h; output goes to out-debug.
49 # Use same configuration, but different output directory:
53 # uses config.make and config.h; output goes to out-www.
58 outbase=out$(CONFIGSUFFIX)
64 config_make=$(depth)/config$(CONFIGSUFFIX).make
69 include $(config_make)
71 include $(depth)/make/toplevel-version.make
72 MICRO_VERSION=$(PATCH_LEVEL)
76 outdir=$(outroot)/$(outbase)
79 config_h=$(top-build-dir)/config$(CONFIGSUFFIX).hh
81 # The outdir that was configured for: best guess to find binaries
82 outconfbase=out$(CONFIGSUFFIX)
83 outconfdir=$(outroot)/$(outconfbase)
86 stepdir = $(stepmake)/stepmake
87 # for stepmake package
88 # stepdir = $(depth)/stepmake
90 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES)
91 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
93 # Don't try to outsmart us, you puny computer!
94 # Well, UGH. This only removes builtin rules from
95 # subsequent $(MAKE)s, *not* from the current run!
96 ifeq ($(BUILTINS_REMOVED),)
97 export BUILTINS_REMOVED = yes
98 MAKE:=$(MAKE) --no-builtin-rules
99 include $(stepdir)/no-builtin-rules.make
105 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
107 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
110 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
112 # ugh. need to do this because of PATH :=$(top-src-dir)/..:$(PATH)
113 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES)))
116 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES)))
117 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES)))
118 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES)))
119 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES)))