]> git.donarmstrong.com Git - lilypond.git/blob - make/stepmake.make
* flower/string.cc (substitute): Take two strings or two
[lilypond.git] / make / stepmake.make
1 # make/Stepmake.make
2
3 # If usescons=something then reroute to scons if user is using that.
4 ifdef usescons
5
6 SCONS_USER = $(wildcard $(depth)/.sconsign)
7 ifeq ($(SCONS_USER),)
8 SCONS_USER = $(wildcard $(depth)/.sconf_temp)
9 endif
10 ifneq ($(SCONS_USER),)
11
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
21
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
25
26 $(MAKE_TARGETS): scons
27
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
36
37 include $(depth)/make/toplevel-version.make
38 MICRO_VERSION=$(PATCH_LEVEL)
39 BUILD_VERSION=1
40
41 # Use alternate configurations alongside eachother:
42 #
43 #     ./configure --enable-config=debug
44 #     make conf=debug
45 #
46 # uses config-debug.make and config-debug.h; output goes to out-debug.
47 #
48 ifdef conf
49   CONFIGSUFFIX=-$(conf)
50 endif
51
52 # Use same configuration, but different output directory:
53 #
54 #     make out=www
55 #
56 # uses config.make and config.h; output goes to out-www.
57 #
58 ifdef out
59   outbase=out-$(out)
60 else
61   outbase=out$(CONFIGSUFFIX)
62 endif
63
64 ifdef config
65   config_make=$(config)
66 else
67   ifeq ($(builddir),)
68     config_make=$(depth)/config$(CONFIGSUFFIX).make
69   else
70     config_make=$(builddir)/config$(CONFIGSUFFIX).make
71   endif
72 endif
73
74 ifeq ($(builddir),)
75   outroot=.
76 else
77   outroot=$(builddir)$(patsubst $(shell cd $(depth); pwd)%,%,$(pwd))
78 endif
79
80 include $(config_make)
81
82 outdir=$(outroot)/$(outbase)
83
84 # why not generic ?? 
85 config_h=$(builddir)/config$(CONFIGSUFFIX).hh
86
87 # The outdir that was configured for: best guess to find binaries
88 outconfbase=out$(CONFIGSUFFIX)
89 outconfdir=$(outroot)/$(outconfbase)
90
91 # user package
92 stepdir = $(stepmake)/stepmake
93 # for stepmake package
94 # stepdir = $(depth)/stepmake
95
96 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) 
97 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
98
99 # Don't try to outsmart us, you puny computer!
100 # Well, UGH.  This only removes builtin rules from
101 # subsequent $(MAKE)s, *not* from the current run!
102 ifeq ($(BUILTINS_REMOVED),)
103   export BUILTINS_REMOVED = yes
104   MAKE:=$(MAKE) --no-builtin-rules
105   include $(stepdir)/no-builtin-rules.make
106 endif
107 .SUFFIXES:
108
109 all:
110
111 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
112
113 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
114
115
116 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
117
118 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH) 
119 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES))) 
120
121
122 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES))) 
123 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES))) 
124 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES))) 
125 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES))) 
126
127