]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.0.46.jcn1
[lilypond.git] / make / Variables.make
1 #
2 # project  LilyPond -- the musical typesetter
3 # title    generic variables
4 # file     make/Variables.make
5 # abstract do not change this file for site-wide extensions;
6 #          please edit settings in User.make 
7 #
8 # Copyright (c) 1997 by    
9 #       Jan Nieuwenhuizen <jan@digicash.com>
10 #       Han-Wen Nienhuys <hanwen@stack.nl>
11
12 # toplevel version info, might be handy?
13 #
14 include ./$(depth)/.version
15 #
16 include ./$(depth)/make/out/Configure_variables.make
17
18 # ugh, for win32 make
19 # leave me up here, or i won-t work
20 export CXX
21
22 ifeq (0,${MAKELEVEL})
23 MAKE:=$(MAKE) --no-builtin-rules
24 endif
25
26
27 # directory names:
28 #
29 outdir = out# "objects" won-t do, used for libs and deps as well
30 lily_bindir = ./$(depth)/bin
31 distdir = ./$(depth)/$(DIST_NAME)
32 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
33 depdir = $(outdir)
34 flowerout = ./$(depth)/flower/$(outdir)
35 libout = ./$(depth)/lib/$(outdir)
36 libdir = $(outdir)
37 lilyout = ./$(depth)/lily/$(outdir)
38 mi2muout = ./$(depth)/mi2mu/$(outdir)
39 makeout = ./$(depth)/make/$(outdir)
40 doc-dir = ./$(depth)/Documentation
41 flower-dir = ./$(depth)/flower
42 lib-dir = ./$(depth)/lib
43 lily-dir = ./$(depth)/lily
44 mi2mu-dir = ./$(depth)/mi2mu
45 make-dir = ./$(depth)/make
46 include-lib = ./$(depth)/lib/include
47 include-flower = ./$(depth)/flower/include
48 #
49 rpm-sources = /usr/src/redhat/SOURCES
50 #
51
52 # user settings:
53 #
54 include ./$(depth)/make/User.make
55 #
56 #
57 # need to be defined in local Makefiles:
58 # build = ./$(depth)/lily/$(outdir)/.build ######## UGR!
59 BUILD = $(shell cat $(build))
60 INCREASE_BUILD = echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
61 #
62
63 # the version:
64 #
65 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
66 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
67 #
68
69
70 # module and top level dist:
71 #
72 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
73 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
74 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
75 #
76
77 # list of object files:
78 #
79 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
80 OFILEC = $(SOURCE_FILES:.c=.o)
81 OFILECC = $(OFILEC:.cc=.o)
82 OFILEL = $(OFILECC:.l=.o)
83 OFILEY = $(OFILEL:.y=.o)
84 OFILES = $(patsubst %,$(outdir)/%,$(OFILEY))
85 #
86
87 # dummydeps
88 #
89 DUMMYDEPS=\
90  $(flowerout)/dummy.dep\
91  $(libout)/dummy.dep\
92  $(lilyout)/dummy.dep\
93  $(mi2muout)/dummy.dep\
94
95 #
96
97 # clean file lists:
98 #
99 ERROR_LOG = 2> /dev/null
100 SILENT_LOG = >& /dev/null
101 allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu
102 allhh := $(shell $(FIND) -name "*.hh" $(ERROR_LOG))
103 allcc := $(shell $(FIND) -name "*.cc" $(ERROR_LOG))
104 allobs := $(shell $(FIND) $(outdir) -name "*.o" $(ERROR_LOG))
105 allibs := $(shell $(FIND) $(libdir) -name "*.lib" $(ERROR_LOG))
106 alldeps := $(shell $(FIND) $(outdir) -name "*.dep" $(ERROR_LOG))
107
108 # version stuff:
109 #
110 lily-version = $(lilyout)/version.hh
111 flower-version = $(flowerout)/version.hh
112 mi2mu-version = $(mi2muout)/version.hh
113 #
114
115 # custom libraries:
116 #
117 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
118 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
119 #
120
121 # compile and link options:
122 #
123 ARFLAGS = ru
124 CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
125 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS)
126 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
127 CXX_OUTPUT_OPTION = $< -o $@
128 LDFLAGS = $(EXTRA_LDFLAGS)
129 LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES) -lg++ # need lg++ for win32, really!
130 #
131
132 # librarian:
133 #
134 AR = ar
135 AR_COMMAND = $(AR) $(ARFLAGS) $@
136 #
137 RANLIB_COMMAND=$(RANLIB) $@
138 # compiler:
139 #
140
141 DO_CXX_COMPILE=$(DODEP)\
142         $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
143 # "CC = $(CC)"
144 # "CXX = $(CXX)"
145 #
146
147 # linker:
148 #
149 LD = $(CXX)
150 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
151 #
152
153 # dependencies:
154 #
155 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
156 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
157 #
158
159 # utils:
160 #
161 #FLEX = flex
162 #BISON = bison
163 #
164
165 # generic target names:
166 #
167 EXECUTABLE = $(NAME)$(EXE)
168 LIB_PREFIX = lib
169 LIB_SUFFIX = .a
170 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
171 #
172
173 STRIPDEBUG=true #replace to do stripping of certain objects
174
175 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
176 DOCDIR=$(depth)/$(outdir)
177
178 # .hh should be first. Don't know why
179 progdocs=$(shell find -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
180 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
181         --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
182 STRIP=strip --strip-debug
183 ifdef stablecc
184  STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
185 endif
186 stablecc=
187 DO_STRIP=true
188