* python/lilylib.py (setup_temp): temporary directories are mode 700.
[lilypond.git] / make / stepmake.make
blob3e7740506463e8d801bd519b2662b8c4fcea578b
1 # make/Stepmake.make
3 include $(depth)/make/toplevel-version.make
5 # Use alternate configurations alongside eachother:
7 # ./configure --enable-config=debug
8 # make conf=debug
10 # uses config-debug.make and config-debug.h; output goes to out-debug.
12 ifdef conf
13 CONFIGSUFFIX=-$(conf)
14 endif
16 # Use same configuration, but different output directory:
18 # make out=www
20 # uses config.make and config.h; output goes to out-www.
22 ifdef out
23 outbase=out-$(out)
24 else
25 outbase=out$(CONFIGSUFFIX)
26 endif
28 ifdef config
29 configuration=$(config)
30 else
31 ifeq ($(builddir),)
32 configuration=$(depth)/config$(CONFIGSUFFIX).make
33 else
34 configuration=$(builddir)/config$(CONFIGSUFFIX).make
35 endif
36 endif
38 ifeq ($(builddir),)
39 outroot=.
40 else
41 outroot=$(builddir)/$(patsubst $(shell cd $(depth); pwd)%,%,$(pwd))
42 endif
44 include $(configuration)
46 outdir=$(outroot)/$(outbase)
48 # why not generic ??
49 config_h=$(builddir)/config$(CONFIGSUFFIX).h
51 # The outdir that was configured for: best guess to find binaries
52 outconfbase=out$(CONFIGSUFFIX)
53 outconfdir=$(outroot)/$(outconfbase)
55 # user package
56 stepdir = $(stepmake)/stepmake
57 # for stepmake package
58 # stepdir = $(depth)/stepmake
60 STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES)
61 LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES)
63 # Don't try to outsmart us, you puny computer!
64 # Well, UGH. This only removes builtin rules from
65 # subsequent $(MAKE)s, *not* from the current run!
66 ifeq ($(BUILTINS_REMOVED),)
67 export BUILTINS_REMOVED = yes
68 MAKE:=$(MAKE) --no-builtin-rules
69 include $(stepdir)/no-builtin-rules.make
70 endif
71 .SUFFIXES:
73 all:
75 -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES)))
77 -include $(addprefix $(stepdir)/,$(addsuffix -inclusions.make, $(STEPMAKE_TEMPLATES)))
80 include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
82 # ugh. need to do this because of PATH :=$(topdir)/..:$(PATH)
83 include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES)))
86 include $(addprefix $(depth)/make/,$(addsuffix -rules.make, $(LOCALSTEPMAKE_TEMPLATES)))
87 include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES)))
88 include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES)))
89 include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES)))