]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.0.54
[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 include ./$(depth)/make/out/Configure_variables.make
20
21 ifeq (0,${MAKELEVEL})
22 MAKE:=$(MAKE) --no-builtin-rules
23 endif
24
25 # directory names:
26 #
27 outdir = out
28 lily_bindir = ./$(depth)/bin
29 distdir = ./$(depth)/$(DIST_NAME)
30 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
31 depdir = $(outdir)
32 flowerout = ./$(depth)/flower/$(outdir)
33 libout = ./$(depth)/lib/$(outdir)
34 lilyout = ./$(depth)/lily/$(outdir)
35 mi2muout = ./$(depth)/mi2mu/$(outdir)
36 makeout = ./$(depth)/make/$(outdir)
37 doc-dir = ./$(depth)/Documentation
38 flower-dir = ./$(depth)/flower
39 lib-dir = ./$(depth)/lib
40 lily-dir = ./$(depth)/lily
41 mi2mu-dir = ./$(depth)/mi2mu
42 make-dir = ./$(depth)/make
43 include-lib = ./$(depth)/lib/include
44 include-flower = ./$(depth)/flower/include
45 #
46 rpm-sources = ${HOME}/rpms/SOURCES
47 #
48
49 # user settings:
50 #
51 include ./$(depth)/make/User.make
52 #
53 #
54 # need to be defined in local Makefiles:
55 # build = ./$(depth)/lily/$(outdir)/.build ######## UGR!
56 BUILD = $(shell cat $(build))
57 INCREASE_BUILD = echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
58 #
59
60 # the version:
61 #
62 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
63 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
64 #
65
66
67 # module and top level dist:
68 #
69 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
70 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
71 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
72 #
73
74 # list of object files:
75 #
76 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
77 OFILEC = $(SOURCE_FILES:.c=.o)
78 OFILECC = $(OFILEC:.cc=.o)
79 OFILEL = $(OFILECC:.l=.o)
80 OFILEY = $(OFILEL:.y=.o)
81 OFILES = $(addprefix $(outdir)/,$(OFILEY))
82 #
83
84 # dummydeps
85 #
86 DUMMYDEPS=\
87  $(flowerout)/dummy.dep\
88  $(libout)/dummy.dep\
89  $(lilyout)/dummy.dep\
90  $(mi2muout)/dummy.dep\
91
92 #
93
94 # clean file lists:
95 #
96 ERROR_LOG = 2> /dev/null
97 SILENT_LOG = 2>&1 >  /dev/null
98 allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu
99 date = $(shell date +%x)
100 allhh := $(shell $(FIND) ./ -name "*.hh" $(ERROR_LOG))
101 allcc := $(shell $(FIND)  ./ -name "*.cc" $(ERROR_LOG))
102 allobs := $(shell $(FIND) ./  $(outdir) -name "*.o" $(ERROR_LOG))
103
104 alldeps := $(shell $(FIND)  ./ $(outdir) -name "*.dep" $(ERROR_LOG))
105
106 # version stuff:
107 #
108 lily-version = $(lilyout)/version.hh
109 flower-version = $(flowerout)/version.hh
110 mi2mu-version = $(mi2muout)/version.hh
111 #
112
113 # custom libraries:
114 #
115 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
116 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
117 #
118
119 # compile and link options:
120 #
121 ARFLAGS = ru
122 CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
123
124 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
125 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
126
127 # -pipe makes it go faster, but is not supported on all platforms. 
128 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
129
130
131 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
132 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
133 CXX_OUTPUT_OPTION = $< -o $@
134 LDFLAGS = $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/out -L$(depth)/flower/out
135 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
136 #
137
138 # librarian:
139 #
140 AR = ar
141 AR_COMMAND = $(AR) $(ARFLAGS) $@
142 #
143 RANLIB_COMMAND=$(RANLIB) $@
144 # compiler:
145 #
146
147 DO_CXX_COMPILE=$(DODEP)\
148         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
149 # "CC = $(CC)"
150 # "CXX = $(CXX)"
151 #
152
153 # linker:
154 #
155 LD = $(CXX)
156 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
157 #
158
159 # dependencies:
160 #
161 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
162 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
163 #
164
165 # utils:
166 #
167 #FLEX = flex
168 #BISON = bison
169 #
170
171 # generic target names:
172 #
173 EXECUTABLE = $(NAME)$(EXE)
174 LIB_PREFIX = lib
175
176 ifndef LIB_SUFFIX
177 LIB_SUFFIX = .a
178 endif
179
180 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
181 #
182
183 #replace to do stripping of certain objects
184 STRIPDEBUG=true 
185
186 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
187 DOCDIR=$(depth)/$(outdir)
188
189 # .hh should be first. Don't know why
190 # take some trouble to vauto ignore sources and obsolete stuff.
191 progdocs=$(shell find ./ -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
192
193
194 pod2html=pod2html
195 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
196         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
197
198
199 STRIP=strip --strip-debug
200 ifdef stablecc
201  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
202 endif
203
204 # substitute $(STRIP) if you want stripping
205 DO_STRIP=true
206