]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.0.53
[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 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 EXTRA_CXXFLAGS=-pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
127
128
129 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
130 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
131 CXX_OUTPUT_OPTION = $< -o $@
132 LDFLAGS = $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L $(depth)/lib/out -L $(depth)/flower/out
133 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
134 #
135
136 # librarian:
137 #
138 AR = ar
139 AR_COMMAND = $(AR) $(ARFLAGS) $@
140 #
141 RANLIB_COMMAND=$(RANLIB) $@
142 # compiler:
143 #
144
145 DO_CXX_COMPILE=$(DODEP)\
146         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
147 # "CC = $(CC)"
148 # "CXX = $(CXX)"
149 #
150
151 # linker:
152 #
153 LD = $(CXX)
154 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
155 #
156
157 # dependencies:
158 #
159 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
160 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
161 #
162
163 # utils:
164 #
165 #FLEX = flex
166 #BISON = bison
167 #
168
169 # generic target names:
170 #
171 EXECUTABLE = $(NAME)$(EXE)
172 LIB_PREFIX = lib
173
174 ifndef LIB_SUFFIX
175 LIB_SUFFIX = .a
176 endif
177
178 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
179 #
180
181 STRIPDEBUG=true #replace to do stripping of certain objects
182
183 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
184 DOCDIR=$(depth)/$(outdir)
185
186 # .hh should be first. Don't know why
187 # take some trouble to auto sources and obsolete stuff.
188 progdocs=$(shell find -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
189
190
191 pod2html=pod2html
192 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
193         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
194
195
196 STRIP=strip --strip-debug
197 ifdef stablecc
198  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
199 endif
200
201 # substitute $(STRIP) if you want stripping
202 DO_STRIP=true
203