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