lilypond-1.4.2
[lilypond.git] / make / stepmake.make
blobd92fd1ff662b3871ed19f2596c392bdd65c1b9c3
1 # make/Stepmake.make
3 include $(depth)/make/toplevel-version.make
6 # Use alternate configurations alongside eachother:
8 # ./configure --enable-config=debug
9 # make conf=debug
11 # uses config-debug.make and config-debug.h; output goes to out-debug.
13 ifdef conf
14 CONFIGSUFFIX=-$(conf)
15 endif
17 # Use same configuration, but different output directory:
19 # make out=www
21 # uses config.make and config.h; output goes to out-www.
23 ifdef out
24 outbase=out-$(out)
25 else
26 outbase=out$(CONFIGSUFFIX)
27 endif
29 ifdef config
30 configuration=$(config)
31 else
32 ifeq ($(builddir),.)
33 configuration=$(depth)/config$(CONFIGSUFFIX).make
34 else
35 # user package
36 configuration=$(depth)/$(builddir)/config$(CONFIGSUFFIX).make
37 # stepmake package
38 #configuration=$(depth)/../$(builddir)/stepmake/config$(CONFIGSUFFIX).make
39 endif
40 endif
42 include $(configuration)
44 ifeq ($(builddir),.)
45 outroot=$(builddir)
46 else
47 outroot=$(depth)/$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(shell cd .; pwd))
48 endif
50 outdir=$(outroot)/$(outbase)
51 config_h=$(depth)/$(builddir)/config$(CONFIGSUFFIX).h
53 # The outdir that was configured for: best guess to find binaries
54 outconfbase=out$(CONFIGSUFFIX)
55 outconfdir=$(outroot)/$(outconfbase)
57 # user package
58 stepdir = $(stepmake)/stepmake
59 # for stepmake package
60 # stepdir = $(depth)/stepmake
62 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES)
63 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
65 # Don't try to outsmart us, you puny computer!
66 # Well, UGH. This only removes builtin rules from
67 # subsequent $(MAKE)s, *not* from the current run!
68 ifeq ($(BUILTINS_REMOVED),)
69 export BUILTINS_REMOVED = yes
70 MAKE:=$(MAKE) --no-builtin-rules
71 include $(stepdir)/no-builtin-rules.make
72 endif
73 .SUFFIXES:
75 all:
77 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
79 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
82 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
84 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH)
85 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES)))
88 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES)))
89 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES)))
90 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES)))
91 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES)))