]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/make/stepmake.make
* cygwin/changelog:
[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   config_make=$(config)
30 else
31   ifeq ($(builddir),)
32     config_make=$(depth)/config$(CONFIGSUFFIX).make
33   else
34     config_make=$(builddir)/config$(CONFIGSUFFIX).make
35   endif
36 endif
37
38 ifeq ($(builddir),)
39   outroot=.
40 else
41   outroot=$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(pwd))
42 endif
43
44 include $(config_make)
45
46 outdir=$(outroot)/$(outbase)
47 config_h=$(builddir)/config$(CONFIGSUFFIX).h
48
49 # The outdir that was configured for: best guess to find binaries
50 outconfbase=out$(CONFIGSUFFIX)
51 outconfdir=$(outroot)/$(outconfbase)
52
53 # user package
54 # stepdir = $(stepmake)/stepmake
55 # for stepmake package
56 stepdir = $(depth)/stepmake
57
58 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) 
59 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
60
61
62 # Don't try to outsmart us, you puny computer!
63 # Well, UGH.  This only removes builtin rules from
64 # subsequent $(MAKE)s, *not* from the current run!
65 ifeq ($(BUILTINS_REMOVED),)
66   export BUILTINS_REMOVED = yes
67   MAKE:=$(MAKE) --no-builtin-rules
68   include $(stepdir)/no-builtin-rules.make
69 endif
70 .SUFFIXES:
71
72 all:
73
74 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
75
76 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
77
78
79 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
80
81 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH) 
82 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES))) 
83
84
85 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES))) 
86 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES))) 
87 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES))) 
88 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES))) 
89
90