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