]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/make/stepmake.make
b98bd15401be1a5bc272f298ed95cd772ae10f68
[lilypond.git] / stepmake / make / stepmake.make
1 # make/Stepmake.make
2
3 include $(depth)/make/toplevel-version.make
4
5 # Use alternate configurations alongside eachother:
6 #
7 #     ./configure --enable-config=debug
8 #     make conf=debug
9 #
10 # uses config-debug.make and config-debug.h; output goes to out-debug.
11 #
12 ifdef conf
13   CONFIGSUFFIX=-$(conf)
14 endif
15
16 # Use same configuration, but different output directory:
17 #
18 #     make out=www
19 #
20 # uses config.make and config.h; output goes to out-www.
21 #
22 ifdef out
23   outbase=out-$(out)
24 else
25   outbase=out$(CONFIGSUFFIX)
26 endif
27
28 ifdef config
29   configuration=$(config)
30 else
31   ifeq ($(builddir),.)
32     configuration=$(depth)/config$(CONFIGSUFFIX).make
33   else
34     # user package
35     configuration=$(depth)/$(builddir)/config$(CONFIGSUFFIX).make
36     # stepmake package
37     configuration=$(depth)/../$(builddir)/stepmake/config$(CONFIGSUFFIX).make
38   endif
39 endif
40
41 include $(configuration)
42
43 ifeq ($(builddir),.)
44   outroot=$(builddir)
45 else
46   outroot=$(depth)/$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(shell cd .; pwd))
47 endif
48
49 outdir=$(outroot)/$(outbase)
50 config_h=$(depth)/$(builddir)/config$(CONFIGSUFFIX).h
51
52 # The outdir that was configured for: best guess to find binaries
53 outconfbase=out$(CONFIGSUFFIX)
54 outconfdir=$(outroot)/$(outconfbase)
55
56 # user package
57 # stepdir = $(stepmake)/stepmake
58 # for stepmake package
59 stepdir = $(depth)/stepmake
60
61 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) 
62 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
63
64
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 (0,${MAKELEVEL})
69   MAKE:=$(MAKE) --no-builtin-rules
70   include $(stepdir)/no-builtin-rules.make
71 endif
72 .SUFFIXES:
73
74 all:
75
76 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
77
78 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
79
80
81 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
82
83 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH) 
84 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES))) 
85
86
87 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES))) 
88 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES))) 
89 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES))) 
90 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES))) 
91
92