]> git.donarmstrong.com Git - lilypond.git/blob - make/stepmake.make
* stepmake/GNUmakefile.in: remove nested stepmake packaging stuff.
[lilypond.git] / make / stepmake.make
1 # make/Stepmake.make
2
3 include $(depth)/make/toplevel-version.make
4 # Use alternate configurations alongside eachother:
5 #
6 #     ./configure --enable-config=debug
7 #     make conf=debug
8 #
9 # uses config-debug.make and config-debug.h; output goes to out-debug.
10 #
11 ifdef conf
12   CONFIGSUFFIX=-$(conf)
13 endif
14
15 # Use same configuration, but different output directory:
16 #
17 #     make out=www
18 #
19 # uses config.make and config.h; output goes to out-www.
20 #
21 ifdef out
22   outbase=out-$(out)
23 else
24   outbase=out$(CONFIGSUFFIX)
25 endif
26
27 ifdef config
28   config_make=$(config)
29 else
30   ifeq ($(builddir),)
31     config_make=$(depth)/config$(CONFIGSUFFIX).make
32   else
33     config_make=$(builddir)/config$(CONFIGSUFFIX).make
34   endif
35 endif
36
37 ifeq ($(builddir),)
38   outroot=.
39 else
40   outroot=$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(pwd))
41 endif
42
43 include $(config_make)
44
45 outdir=$(outroot)/$(outbase)
46
47 # why not generic ?? 
48 config_h=$(builddir)/config$(CONFIGSUFFIX).h
49
50 # The outdir that was configured for: best guess to find binaries
51 outconfbase=out$(CONFIGSUFFIX)
52 outconfdir=$(outroot)/$(outconfbase)
53
54 # user package
55 stepdir = $(stepmake)/stepmake
56 # for stepmake package
57 # stepdir = $(depth)/stepmake
58
59 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) 
60 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
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