* cygwin/GNUmakefile (INSTALLATION_OUT_SUFFIXES): Remove profile
[lilypond/patrick.git] / make / stepmake.make
blob71dde6f7f8940545c24dae69154970129f927c47
1 # make/Stepmake.make
3 # If usescons=something then reroute to scons if user is using that.
4 ifdef usescons
6 SCONS_USER = $(wildcard $(depth)/.sconsign)
7 ifeq ($(SCONS_USER),)
8 SCONS_USER = $(wildcard $(depth)/.sconf_temp)
9 endif
10 ifneq ($(SCONS_USER),)
12 ifeq ($(strip $(depth)),..)
13 here = $(notdir $(CURDIR))
14 else
15 ifeq ($(strip $(depth)),../..)
16 # ZUCHT?
17 # here = $(notdir $(dir $(CURDIR)))/$(notdir $(CURDIR))
18 here = $(shell basename $$(dirname $(CURDIR)))/$(notdir $(CURDIR))
19 endif
20 endif
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.
30 scons:
31 @echo "warning: $(SCONS_USER) detected, rerouting to scons"
32 cd $(depth) && scons $(here) $(MAKECMDGOALS)
33 false
34 endif
35 endif
37 include $(depth)/make/toplevel-version.make
39 # Use alternate configurations alongside eachother:
41 # ./configure --enable-config=debug
42 # make conf=debug
44 # uses config-debug.make and config-debug.h; output goes to out-debug.
46 ifdef conf
47 CONFIGSUFFIX=-$(conf)
48 endif
50 # Use same configuration, but different output directory:
52 # make out=www
54 # uses config.make and config.h; output goes to out-www.
56 ifdef out
57 outbase=out-$(out)
58 else
59 outbase=out$(CONFIGSUFFIX)
60 endif
62 ifdef config
63 config_make=$(config)
64 else
65 ifeq ($(builddir),)
66 config_make=$(depth)/config$(CONFIGSUFFIX).make
67 else
68 config_make=$(builddir)/config$(CONFIGSUFFIX).make
69 endif
70 endif
72 ifeq ($(builddir),)
73 outroot=.
74 else
75 outroot=$(builddir)$(patsubst $(shell cd $(depth); pwd)%,%,$(pwd))
76 endif
78 include $(config_make)
80 outdir=$(outroot)/$(outbase)
82 # why not generic ??
83 config_h=$(builddir)/config$(CONFIGSUFFIX).hh
85 # The outdir that was configured for: best guess to find binaries
86 outconfbase=out$(CONFIGSUFFIX)
87 outconfdir=$(outroot)/$(outconfbase)
89 # user package
90 stepdir = $(stepmake)/stepmake
91 # for stepmake package
92 # stepdir = $(depth)/stepmake
94 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES)
95 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
97 # Don't try to outsmart us, you puny computer!
98 # Well, UGH. This only removes builtin rules from
99 # subsequent $(MAKE)s, *not* from the current run!
100 ifeq ($(BUILTINS_REMOVED),)
101 export BUILTINS_REMOVED = yes
102 MAKE:=$(MAKE) --no-builtin-rules
103 include $(stepdir)/no-builtin-rules.make
104 endif
105 .SUFFIXES:
107 all:
109 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
111 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
114 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
116 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH)
117 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES)))
120 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES)))
121 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES)))
122 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES)))
123 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES)))