]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.0.78
[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/out/Site.make; 
9 # Any change in files in this directory (make/) would be distributed.
10 #
11 # Copyright (c) 1997 by    
12 #       Jan Nieuwenhuizen <jan@digicash.com>
13 #       Han-Wen Nienhuys <hanwen@stack.nl>
14
15 # toplevel version info, might be handy?
16 #
17 include $(depth)/VERSION
18 #
19 ifeq (0,${MAKELEVEL})
20 MAKE:=$(MAKE) --no-builtin-rules
21 endif
22
23 # directory names:
24
25
26 ifdef buildprefix
27 top-directory := $(shell  cd $(depth); pwd)
28 abs-sub-directory := $(shell pwd)
29 relative-sub-directory := $(subst $(top-directory),,$(abs-sub-directory))
30 outdir=$(buildprefix)/$(relative-sub-directory)/out/
31 else
32 buildprefix=$(depth)
33 outdir=out
34 endif
35
36 # derived names
37 lily_bindir = $(depth)/bin
38 distdir = $(depth)/$(DIST_NAME)
39 module-distdir = $(depth)/$(MODULE_DIST_NAME)
40 depdir = $(outdir)
41
42 flowerout = $(buildprefix)/flower/out
43 libout = $(buildprefix)/lib/out
44 lilyout = $(buildprefix)/lily/out
45 mi2muout = $(buildprefix)/mi2mu/out
46 makeout = $(buildprefix)/make/out
47 docout = $(buildprefix)/Documentation/out
48 binout = $(buildprefix)/bin/out
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
76 # the version:
77 #
78 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
79 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
80 #
81
82
83 # module and top level dist:
84 #
85 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
86 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
87 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
88 #
89
90 # list of object files:
91 #
92 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
93 OFILEC = $(SOURCE_FILES:.c=.o)
94 OFILECC = $(OFILEC:.cc=.o)
95 OFILEL = $(OFILECC:.l=.o)
96 OFILEY = $(OFILEL:.y=.o)
97 OFILES = $(addprefix $(outdir)/,$(OFILEY))
98 #
99
100 # dummydeps
101 #
102 DUMMYDEPS=\
103  $(flowerout)/dummy.dep\
104  $(libout)/dummy.dep\
105  $(lilyout)/dummy.dep\
106  $(mi2muout)/dummy.dep\
107
108 #
109
110 # clean file lists:
111 #
112 ERROR_LOG = 2> /dev/null
113 SILENT_LOG = 2>&1 >  /dev/null
114 date = $(shell date +%x)
115
116 # version stuff:
117 #
118 lily-version = $(lilyout)/version.hh
119 flower-version = $(flowerout)/version.hh
120 mi2mu-version = $(mi2muout)/version.hh
121 #
122
123 # custom libraries:
124 #
125 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
126 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
127 #
128
129 # compile and link options:
130 #
131 ARFLAGS = ru
132 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
133
134 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
135 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
136
137 # -pipe makes it go faster, but is not supported on all platforms. 
138 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
139
140
141 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
142 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
143 CXX_OUTPUT_OPTION = $< -o $@
144 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/out -L$(depth)/flower/out
145 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
146 #
147
148 # librarian:
149 #
150 AR = ar
151 AR_COMMAND = $(AR) $(ARFLAGS) $@
152 #
153 RANLIB_COMMAND=$(RANLIB) $@
154 # compiler:
155 #
156
157 DO_CXX_COMPILE=$(DODEP)\
158         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
159 # "CC = $(CC)"
160 # "CXX = $(CXX)"
161 #
162
163 # linker:
164 #
165 LD = $(CXX)
166 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
167 #
168
169 # dependencies:
170 #
171 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@)) 
172 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
173 #
174
175 # utils:
176 #
177 #FLEX = flex
178 #BISON = bison
179 #
180
181 # generic target names:
182 #
183 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
184 EXECUTABLES = $(EXECUTABLE)
185 LIB_PREFIX = lib
186
187 ifndef LIB_SUFFIX
188 LIB_SUFFIX = .a
189 endif
190
191 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
192 #
193
194 #replace to do stripping of certain objects
195 STRIPDEBUG=true 
196
197 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
198 DOCDIR=$(depth)/$(outdir)
199
200 # .hh should be first. Don't know why
201 # take some trouble to auto ignore sources and obsolete stuff.
202 progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v 'out/') $(shell $(FIND) ./ -name '*.cc'|egrep -v 'out/')
203
204
205 pod2html=pod2html
206 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
207         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
208
209
210 STRIP=strip --strip-debug
211 ifdef stablecc
212  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
213 endif
214
215 # substitute $(STRIP) in Site.make if you want stripping
216 DO_STRIP=true
217