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