]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.0.52
[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# "objects" won-t do, used for libs and deps as well
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 = >& /dev/null
98 allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu
99 allhh := $(shell $(FIND) -name "*.hh" $(ERROR_LOG))
100 allcc := $(shell $(FIND) -name "*.cc" $(ERROR_LOG))
101 allobs := $(shell $(FIND) $(outdir) -name "*.o" $(ERROR_LOG))
102
103 alldeps := $(shell $(FIND) $(outdir) -name "*.dep" $(ERROR_LOG))
104
105 # version stuff:
106 #
107 lily-version = $(lilyout)/version.hh
108 flower-version = $(flowerout)/version.hh
109 mi2mu-version = $(mi2muout)/version.hh
110 #
111
112 # custom libraries:
113 #
114 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
115 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
116 #
117
118 # compile and link options:
119 #
120 ARFLAGS = ru
121 CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
122
123 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
124 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
125 EXTRA_CXXFLAGS=-pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
126
127
128 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
129 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
130 CXX_OUTPUT_OPTION = $< -o $@
131 LDFLAGS = $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L $(depth)/lib/out -L $(depth)/flower/out
132 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
133 #
134
135 # librarian:
136 #
137 AR = ar
138 AR_COMMAND = $(AR) $(ARFLAGS) $@
139 #
140 RANLIB_COMMAND=$(RANLIB) $@
141 # compiler:
142 #
143
144 DO_CXX_COMPILE=$(DODEP)\
145         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
146 # "CC = $(CC)"
147 # "CXX = $(CXX)"
148 #
149
150 # linker:
151 #
152 LD = $(CXX)
153 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
154 #
155
156 # dependencies:
157 #
158 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
159 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
160 #
161
162 # utils:
163 #
164 #FLEX = flex
165 #BISON = bison
166 #
167
168 # generic target names:
169 #
170 EXECUTABLE = $(NAME)$(EXE)
171 LIB_PREFIX = lib
172
173 ifndef LIB_SUFFIX
174 LIB_SUFFIX = .a
175 endif
176
177 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
178 #
179
180 STRIPDEBUG=true #replace to do stripping of certain objects
181
182 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
183 DOCDIR=$(depth)/$(outdir)
184
185 # .hh should be first. Don't know why
186 # take some trouble to auto sources and obsolete stuff.
187 progdocs=$(shell find -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
188
189
190 pod2html=pod2html
191 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
192         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
193
194
195 STRIP=strip --strip-debug
196 ifdef stablecc
197  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
198 endif
199
200 # substitute $(STRIP) if you want stripping
201 DO_STRIP=true
202