]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
cab4ed184b8ea448042daaf82d4fd16a27e94b05
[lilypond.git] / make / Variables.make
1 #
2 # project  LilyPond -- the musical typesetter
3 # title    generic variables
4 # file     make/Variables.make
5 # abstract 
6 #
7 # do not change this file for site-wide extensions; please use 
8 # make/$(OUTDIR_NAME)/Site.make; 
9 #
10 # Any change in files in this directory (make/) would be distributed, if 
11 # you do make dist 
12 #
13 # Copyright (c) 1997 by    
14 #       Jan Nieuwenhuizen <jan@digicash.com>
15 #       Han-Wen Nienhuys <hanwen@stack.nl>
16
17 # toplevel version info, might be handy?
18 #
19 include $(depth)/VERSION
20
21
22 ifeq (0,${MAKELEVEL})
23
24 # Don't try to outsmart us, you puny computer!
25 MAKE:=$(MAKE) --no-builtin-rules
26 endif
27
28 ifndef OUTDIR_NAME
29 OUTDIR_NAME=out
30 endif
31
32 # directory names:
33 buildprefix=$(depth)
34 outdir=$(OUTDIR_NAME)
35
36 # derived names
37 lily_bindir = $(depth)/bin
38 distdir = $(depth)/$(outdir)/$(DIST_NAME)
39 module-distdir = $(depth)/$(MODULE_DIST_NAME)
40 depdir = $(outdir)
41
42 flowerout = $(buildprefix)/flower/$(OUTDIR_NAME)
43 libout = $(buildprefix)/lib/$(OUTDIR_NAME)
44 lilyout = $(buildprefix)/lily/$(OUTDIR_NAME)
45 mi2muout = $(buildprefix)/mi2mu/$(OUTDIR_NAME)
46 makeout = $(buildprefix)/make/$(OUTDIR_NAME)
47 docout = $(buildprefix)/Documentation/$(OUTDIR_NAME)
48 binout = $(buildprefix)/bin/$(OUTDIR_NAME)
49
50 doc-dir = $(depth)/Documentation
51 flower-dir = $(depth)/flower
52 lib-dir = $(depth)/lib
53 lily-dir = $(depth)/lily
54 mi2mu-dir = $(depth)/mi2mu
55 make-dir = $(depth)/make
56 include-lib = $(depth)/lib/include
57 include-flower = $(depth)/flower/include
58
59
60 rpm-sources = ${HOME}/rpms/SOURCES
61 #
62
63 #include $(makeout)/Configure_variables.make
64
65 # user settings:
66 #
67 include $(depth)/make/User.make
68 #
69 #
70 # need to be defined in local Makefiles:
71 # build = ./$(depth)/lily/$(outdir)/.build ######## UGR!
72 BUILD = $(shell cat $(build))
73 INCREASE_BUILD = echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
74 #
75 FOOBAR = 
76 # the version:
77 #
78 ifneq ($(MY_PATCH_LEVEL),$(FOOBAR))
79 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL).$(MY_PATCH_LEVEL)
80 else
81 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
82 endif
83
84 ifneq ($(TOPLEVEL_MY_PATCH_LEVEL),$(FOOBAR))
85 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL).$(TOPLEVEL_MY_PATCH_LEVEL)
86 else
87 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)
88 endif
89
90 #
91
92
93 # module and top level dist:
94 #
95 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
96 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
97 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
98 NO_DOOS_DIST = bin flower lib lily make mi2mu out
99 #
100
101 # list of object files:
102 #
103 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
104 OFILEC = $(SOURCE_FILES:.c=.o)
105 OFILECC = $(OFILEC:.cc=.o)
106 OFILEL = $(OFILECC:.l=.o)
107 OFILEY = $(OFILEL:.y=.o)
108 OFILES = $(addprefix $(outdir)/,$(OFILEY))
109 #
110
111 # dummydeps
112 #
113 DUMMYDEPS=\
114  $(flowerout)/dummy.dep\
115  $(libout)/dummy.dep\
116  $(lilyout)/dummy.dep\
117  $(mi2muout)/dummy.dep\
118
119 #
120
121 # clean file lists:
122 #
123 ERROR_LOG = 2> /dev/null
124 SILENT_LOG = 2>&1 >  /dev/null
125 date = $(shell date +%x)
126
127 # version stuff:
128 #
129 lily-version = $(lilyout)/version.hh
130 flower-version = $(flowerout)/version.hh
131 mi2mu-version = $(mi2muout)/version.hh
132 #
133
134 # custom libraries:
135 #
136 LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
137 LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
138 #
139
140 # compile and link options:
141 #
142 ARFLAGS = ru
143 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
144
145 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
146 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
147
148 # -pipe makes it go faster, but is not supported on all platforms. 
149 # EXTRA_CXXFLAGS= -fno-rtti -fno-exceptions -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
150 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
151
152 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
153 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
154 CXX_OUTPUT_OPTION = $< -o $@
155 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(OUTDIR_NAME) -L$(depth)/flower/$(OUTDIR_NAME)
156 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES)  -lstdc++ # need lg++ for win32, really!
157 #
158
159 # macro compiler:
160 #
161 M4 = m4
162
163
164 # librarian:
165 #
166 AR = ar
167 AR_COMMAND = $(AR) $(ARFLAGS) $@
168 #
169 RANLIB_COMMAND=$(RANLIB) $@
170 # compiler:
171 #
172
173 DO_CXX_COMPILE=$(DODEP)\
174         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
175
176 # linker:
177 #
178 LD = $(CXX)
179 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
180 #
181
182 # dependencies:
183 #
184 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))#
185 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
186 #
187
188 # utils:
189 #
190 #FLEX = flex
191 #BISON = bison
192 #
193
194 # generic target names:
195 #
196 ifdef NAME
197 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
198 else
199 EXECUTABLE =
200 endif
201
202 EXECUTABLES = $(EXECUTABLE)
203 LIB_PREFIX = lib
204
205 ifndef LIB_SUFFIX
206 LIB_SUFFIX = .a
207 endif
208
209 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
210 #
211
212 #replace to do stripping of certain objects
213 STRIPDEBUG=true 
214
215 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
216 DOCDIR=$(depth)/$(outdir)
217
218 pod2groff=$(POD2MAN) --center="LilyPond documentation" --section="0"\
219         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
220
221
222 STRIP=strip --strip-debug
223 ifdef stablecc
224  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
225 endif
226
227 # substitute $(STRIP) in Site.make if you want stripping
228 DO_STRIP=true
229
230