lilypond-0.1.45
[lilypond.git] / make / Variables.make
blob884f2ffb2c05df65b8ee88371be3d6a5c8691540
2 # project LilyPond -- the musical typesetter
3 # title generic variables
4 # file make/Variables.make
5 # abstract
7 # do not change this file for site-wide extensions; please use
8 # make/$(OUTDIR_NAME)/Site.make;
10 # Any change in files in this directory (make/) would be distributed, if
11 # you do make dist
13 # Copyright (c) 1997 by
14 # Jan Nieuwenhuizen <jan@digicash.com>
15 # Han-Wen Nienhuys <hanwen@stack.nl>
17 # toplevel version info, might be handy?
19 include $(depth)/VERSION
22 ifeq (0,${MAKELEVEL})
24 # Don't try to outsmart us, you puny computer!
25 MAKE:=$(MAKE) --no-builtin-rules
26 endif
28 ifndef OUTDIR_NAME
29 OUTDIR_NAME=out
30 endif
32 # directory names:
33 buildprefix=$(depth)
34 outdir=$(OUTDIR_NAME)
36 # derived names
37 lily_bindir = $(depth)/bin
38 distdir = $(depth)/$(outdir)/$(DIST_NAME)
39 module-distdir = $(depth)/$(MODULE_DIST_NAME)
40 depdir = $(outdir)
42 flowerout = $(buildprefix)/flower/$(OUTDIR_NAME)
43 libout = $(buildprefix)/lib/$(OUTDIR_NAME)
44 lilyout = $(buildprefix)/lily/$(OUTDIR_NAME)
45 mi2muout = $(buildprefix)/mi2mu/$(OUTDIR_NAME)
46 makeout = $(buildprefix)/make/$(OUTDIR_NAME)
47 docout = $(buildprefix)/Documentation/$(OUTDIR_NAME)
48 binout = $(buildprefix)/bin/$(OUTDIR_NAME)
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
60 rpm-sources = ${HOME}/rpms/SOURCES
63 include $(makeout)/Configure_variables.make
65 # user settings:
67 include $(depth)/make/User.make
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)
75 FOOBAR =
76 # the version:
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
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
93 # module and top level dist:
95 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
96 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
97 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
98 NO_DOOS_DIST = bin flower lib lily make mi2mu out
101 # list of object files:
103 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
104 OFILEC = $(SOURCE_FILES:.c=.o)
105 OFILECC = $(OFILEC:.cc=.o)
106 OFILEL = $(OFILECC:.l=.o)
107 OFILEY = $(OFILEL:.y=.o)
108 OFILES = $(addprefix $(outdir)/,$(OFILEY))
111 # dummydeps
113 DUMMYDEPS=\
114 $(flowerout)/dummy.dep\
115 $(libout)/dummy.dep\
116 $(lilyout)/dummy.dep\
117 $(mi2muout)/dummy.dep\
121 # clean file lists:
123 ERROR_LOG = 2> /dev/null
124 SILENT_LOG = 2>&1 > /dev/null
125 date = $(shell date +%x)
127 # version stuff:
129 lily-version = $(lilyout)/version.hh
130 flower-version = $(flowerout)/version.hh
131 mi2mu-version = $(mi2muout)/version.hh
134 # custom libraries:
136 LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
137 LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
140 # compile and link options:
142 ARFLAGS = ru
143 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
145 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
146 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
148 # -pipe makes it go faster, but is not supported on all platforms.
149 # EXTRA_CXXFLAGS= -fno-rtti -fno-exceptions -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
150 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
152 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
153 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
154 CXX_OUTPUT_OPTION = $< -o $@
155 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(OUTDIR_NAME) -L$(depth)/flower/$(OUTDIR_NAME)
156 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
159 # macro compiler:
161 M4 = m4
164 # librarian:
166 AR = ar
167 AR_COMMAND = $(AR) $(ARFLAGS) $@
169 RANLIB_COMMAND=$(RANLIB) $@
170 # compiler:
173 DO_CXX_COMPILE=$(DODEP)\
174 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
176 # linker:
178 LD = $(CXX)
179 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
182 # dependencies:
184 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))
185 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
188 # utils:
190 #FLEX = flex
191 #BISON = bison
194 # generic target names:
196 ifdef NAME
197 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
198 else
199 EXECUTABLE =
200 endif
202 EXECUTABLES = $(EXECUTABLE)
203 LIB_PREFIX = lib
205 ifndef LIB_SUFFIX
206 LIB_SUFFIX = .a
207 endif
209 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
212 #replace to do stripping of certain objects
213 STRIPDEBUG=true
215 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
216 DOCDIR=$(depth)/$(outdir)
218 pod2html=pod2html
219 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
220 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
223 STRIP=strip --strip-debug
224 ifdef stablecc
225 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
226 endif
228 # substitute $(STRIP) in Site.make if you want stripping
229 DO_STRIP=true