lilypond-0.1.14
[lilypond.git] / make / Variables.make
blobc1a022fa1981a41f4f3399c1ee8644caecb2f74c
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)/$(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)
76 # the version:
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)
83 # module and top level dist:
85 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
86 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
87 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
88 NO_DOOS_DIST = bin flower lib lily make mi2mu out
91 # list of object files:
93 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
94 OFILEC = $(SOURCE_FILES:.c=.o)
95 OFILECC = $(OFILEC:.cc=.o)
96 OFILEL = $(OFILECC:.l=.o)
97 OFILEY = $(OFILEL:.y=.o)
98 OFILES = $(addprefix $(outdir)/,$(OFILEY))
101 # dummydeps
103 DUMMYDEPS=\
104 $(flowerout)/dummy.dep\
105 $(libout)/dummy.dep\
106 $(lilyout)/dummy.dep\
107 $(mi2muout)/dummy.dep\
111 # clean file lists:
113 ERROR_LOG = 2> /dev/null
114 SILENT_LOG = 2>&1 > /dev/null
115 date = $(shell date +%x)
117 # version stuff:
119 lily-version = $(lilyout)/version.hh
120 flower-version = $(flowerout)/version.hh
121 mi2mu-version = $(mi2muout)/version.hh
124 # custom libraries:
126 LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
127 LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
130 # compile and link options:
132 ARFLAGS = ru
133 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
135 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
136 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
138 # -pipe makes it go faster, but is not supported on all platforms.
139 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
142 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
143 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
144 CXX_OUTPUT_OPTION = $< -o $@
145 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(OUTDIR_NAME) -L$(depth)/flower/$(OUTDIR_NAME)
146 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
149 # librarian:
151 AR = ar
152 AR_COMMAND = $(AR) $(ARFLAGS) $@
154 RANLIB_COMMAND=$(RANLIB) $@
155 # compiler:
158 DO_CXX_COMPILE=$(DODEP)\
159 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
161 # linker:
163 LD = $(CXX)
164 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
167 # dependencies:
169 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))
170 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
173 # utils:
175 #FLEX = flex
176 #BISON = bison
179 # generic target names:
181 ifdef NAME
182 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
183 else
184 EXECUTABLE =
185 endif
187 EXECUTABLES = $(EXECUTABLE)
188 LIB_PREFIX = lib
190 ifndef LIB_SUFFIX
191 LIB_SUFFIX = .a
192 endif
194 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
197 #replace to do stripping of certain objects
198 STRIPDEBUG=true
200 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
201 DOCDIR=$(depth)/$(outdir)
203 # .hh should be first. Don't know why
204 # take some trouble to auto ignore sources and obsolete stuff.
205 progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') \
206 $(shell $(FIND) ./ -name '*.cc' |egrep -v '$(OUTDIR_NAME)') \
209 pod2html=pod2html
210 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
211 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
214 STRIP=strip --strip-debug
215 ifdef stablecc
216 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
217 endif
219 # substitute $(STRIP) in Site.make if you want stripping
220 DO_STRIP=true
223 docxx-opts=-S -k -p
224 docxx=doc++