]> git.donarmstrong.com Git - lilypond.git/blob - make/stepmake.make
patch::: 1.3.106.jcn2
[lilypond.git] / make / stepmake.make
1 # make/Stepmake.make
2
3 include $(depth)/make/toplevel-version.make
4
5
6 # Use alternate configurations alongside eachother:
7 #
8 #     ./configure --enable-config=debug
9 #     make conf=debug
10 #
11 # uses config-debug.make and config-debug.h; output goes to out-debug.
12 #
13 ifdef conf
14   CONFIGSUFFIX=-$(conf)
15 endif
16
17 # Use same configuration, but different output directory:
18 #
19 #     make out=www
20 #
21 # uses config.make and config.h; output goes to out-www.
22 #
23 ifdef out
24   outbase=out-$(out)
25 else
26   outbase=out$(CONFIGSUFFIX)
27 endif
28
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
41
42 include $(configuration)
43
44 ifeq ($(builddir),.)
45   outroot=.
46 else
47   outroot=$(depth)/$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(shell cd .; pwd))
48 endif
49
50 outdir=$(outroot)/$(outbase)
51 config_h=$(depth)/$(builddir)/config$(CONFIGSUFFIX).h
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 # Don't try to outsmart us, you puny computer!
62 # Well, UGH.  This only removes builtin rules from
63 # subsequent $(MAKE)s, *not* from the current run!
64 ifeq (0,${MAKELEVEL})
65   MAKE:=$(MAKE) --no-builtin-rules
66   include $(stepdir)/no-builtin-rules.make
67 endif
68 .SUFFIXES:
69
70 all:
71
72 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
73
74 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
75
76
77 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
78
79 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH) 
80 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES))) 
81
82
83 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES))) 
84 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES))) 
85 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES))) 
86 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES))) 
87
88