]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.1.65
[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 # ugh, but it gets hairy without extension..
100 DOTTEXT=.txt
101
102 # for rpmrc only
103 LILYPOND_ROOTDIR=$(shell cd $(depth)/..; pwd)
104
105 #
106 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
107 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
108 # NO_DOOS_DIST = bin flower lib lily make mi2mu out
109 NO_DOOS_DIST = flower lib lily make mi2mu out
110 #
111
112 # list of object files:
113 #
114 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
115 OFILEC = $(SOURCE_FILES:.c=.o)
116 OFILECC = $(OFILEC:.cc=.o)
117 OFILEL = $(OFILECC:.ll=.o)
118 OFILEY = $(OFILEL:.yy=.o)
119 OFILES = $(addprefix $(outdir)/,$(OFILEY))
120 #
121
122 # dummydeps
123 #
124 DUMMYDEPS=\
125  $(flowerout)/dummy.dep\
126  $(libout)/dummy.dep\
127  $(lilyout)/dummy.dep\
128  $(mi2muout)/dummy.dep\
129
130 #
131
132 # clean file lists:
133 #
134 ERROR_LOG = 2> /dev/null
135 SILENT_LOG = 2>&1 >  /dev/null
136 date = $(shell date +%x)
137
138 # version stuff:
139 #
140 lily-version = $(lilyout)/version.hh
141 flower-version = $(flowerout)/version.hh
142 mi2mu-version = $(mi2muout)/version.hh
143 #
144
145 # custom libraries:
146 #
147 LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
148 LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
149 #
150
151 # compile and link options:
152 #
153 ARFLAGS = ru
154 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
155
156 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
157 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
158
159 # -pipe makes it go faster, but is not supported on all platforms. 
160 # EXTRA_CXXFLAGS= -Wall -Winline -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
161 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
162
163 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
164 INCLUDES =  -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
165 CXX_OUTPUT_OPTION = $< -o $@
166 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(outdir) -L$(depth)/flower/$(outdir)
167 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES)  -lstdc++ # need lg++ for win32, really!
168 #
169
170 # macro compiler:
171 #
172 M4 = m4
173
174
175 # librarian:
176 #
177 AR = ar
178 AR_COMMAND = $(AR) $(ARFLAGS) $@
179 #
180 RANLIB_COMMAND=$(RANLIB) $@
181 # compiler:
182 #
183
184 DO_CXX_COMPILE=$(DODEP)\
185         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
186
187 # linker:
188 #
189 LD = $(CXX)
190 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
191 #
192
193 # dependencies:
194 #
195 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))#
196 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
197 #
198
199 # utils:
200 #
201 #FLEX = flex
202 #BISON = bison
203 #
204
205 # generic target names:
206 #
207 ifdef NAME
208 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
209 else
210 EXECUTABLE =
211 endif
212
213 EXECUTABLES = $(EXECUTABLE)
214 LIB_PREFIX = lib
215
216 ifndef LIB_SUFFIX
217 LIB_SUFFIX = .a
218 endif
219
220 LIBRARY = $(outdir)/$(LIB_PREFIX)$(NAME).a
221 SHAREDLIBRARY=$(outdir)/$(LIB_PREFIX)$(NAME).so
222 #
223
224 #replace to do stripping of certain objects
225 STRIPDEBUG=true 
226
227 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
228 DOCDIR=$(depth)/$(outdir)
229
230 pod2groff=$(POD2MAN) --center="LilyPond documentation" --section="0"\
231         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
232
233
234 STRIP=strip --strip-debug
235 ifdef stablecc
236  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
237 endif
238
239 # substitute $(STRIP) in Site.make if you want stripping
240 DO_STRIP=true
241
242 ifdef SUBDIRS
243 LOOP=set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
244 else
245 LOOP=
246 endif
247
248 sed-version= sed 's!@TOPLEVEL_VERSION@!${TOPLEVEL_VERSION}!g'