]> git.donarmstrong.com Git - lilypond.git/blob - make/Variables.make
release: 0.0.40
[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; edit settings in User.make
6 #
7 # Copyright (c) 1997 by    
8 #       Jan Nieuwenhuizen <jan@digicash.com>
9 #       Han-Wen Nienhuys <hanwen@stack.nl>
10
11 # toplevel version info, might be handy?
12 #
13 include ./$(depth)/.version
14 #
15
16 # directory names:
17 #
18 outdir = out# "objects" won-t do, used for libs and deps as well
19 bindir = ./$(depth)/bin
20 distdir = ./$(depth)/$(DIST_NAME)
21 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
22 depdir = $(outdir)
23 flowerout = ./$(depth)/flower/lib/$(outdir)
24 libout = ./$(depth)/lib/$(outdir)
25 libdir = $(outdir)
26 lilyout = ./$(depth)/lily/$(outdir)
27 mi2muout = ./$(depth)/mi2mu/$(outdir)
28 makeout = ./$(depth)/make/$(outdir)
29 flower-dir = ./$(depth)/flower/lib
30 lib-dir = ./$(depth)/lib
31 lily-dir = ./$(depth)/lily
32 mi2mu-dir = ./$(depth)/mi2mu
33 make-dir = ./$(depth)/make
34 include-lib = ./$(depth)/lib/include
35 include-flower = ./$(depth)/flower/lib/include
36 #
37
38 # user settings:
39 #
40 include ./$(depth)/make/User.make
41 #
42
43 ifdef PROFILEFLAG
44         DEFINES+=$(OPTIFLAG) $(PROFILEFLAG)
45         EXTRA_LIBES+=-pg
46 endif
47
48 ifndef DEBUGFLAG
49         DEFINES+=$(OPTIFLAG)
50 else
51         DEFINES+=$(DEBUGFLAG)
52 endif
53
54 # build no:
55 #
56 # need to be defined in local Makefiles:
57 # build = ./$(depth)/lily/.build
58 BUILD = $(shell cat $(build))
59 INCREASE_BUILD = @echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
60 #
61
62 # the version:
63 #
64 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
65 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
66 #
67
68 # compiler version:
69 #
70 CXXVER=`$(CXX) --version`
71 #
72
73 # module and top level dist:
74 #
75 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
76 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
77 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
78 #
79
80 # list of object files:
81 #
82 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
83 OFILEC = $(SOURCE_FILES:.c=.o)
84 OFILECC = $(OFILEC:.cc=.o)
85 OFILEL = $(OFILECC:.l=.o)
86 OFILEY = $(OFILEL:.y=.o)
87 OFILES = $(patsubst %,$(outdir)/%,$(OFILEY))
88 #
89
90 # dummydeps
91 #
92 DUMMYDEPS=\
93  $(flowerout)/dummy.dep\
94  $(libout)/dummy.dep\
95  $(lilyout)/dummy.dep\
96  $(mi2muout)/dummy.dep\
97
98 #
99
100 # clean file lists:
101 #
102 ERROR_LOG = 2> /dev/null
103 allexe = $(bindir)/lilypond $(bindir)/mi2mu
104 allcc = $(shell find -name "*.cc" $(ERROR_LOG))
105 allobs = $(shell find $(outdir) -name "*.o" $(ERROR_LOG))
106 allibs = $(shell find $(libdir) -name "*.lib" $(ERROR_LOG))
107 alldeps = $(shell find $(outdir) -name "*.dep" $(ERROR_LOG))
108 allout = $(shell find . -name "$(outdir)" $(ERROR_LOG))
109 allgen = $(shell find . -name $(genout) -o -name .build $(ERROR_LOG))
110 #
111
112 # config stuff:
113 #
114 # cannot let targets depend upon (out)directory -> will always be out of date!
115 genout = .GENERATE
116 flower-config = $(flowerout)/flower-config.hh
117 lily-config = $(libout)/config.hh
118 #
119
120 # version stuff:
121 #
122 flower-version = $(flowerout)/fversion.hh
123 lily-version = $(lilyout)/version.hh
124 mi2mu-version = $(mi2muout)/version.hh
125 #
126
127 # custom libraries:
128 #
129 LIBFLOWER = $(depth)/flower/lib/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
130 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
131 #
132
133 # compile and link options:
134 #
135 ARFLAGS = ru
136 CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
137 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS)
138 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
139 CXX_OUTPUT_OPTION = $< -o $@
140 LDFLAGS = $(EXTRA_LDFLAGS)
141 LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES) -lg++
142 #
143
144 # librarian:
145 #
146 AR = ar
147 AR_COMMAND = $(AR) $(ARFLAGS) $@
148 #
149
150 # compiler:
151 #
152 # "CC = $(CC)"
153 # "CXX = $(CXX)"
154 #
155
156 # linker:
157 #
158 LD = $(CXX)
159 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
160 #
161
162 # dependencies:
163 #
164 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
165 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
166 #
167
168 # utils:
169 #
170 FLEX = flex
171 BISON = bison
172 #
173
174 # generic target names:
175 #
176 EXECUTABLE = $(NAME)$(EXE)
177 LIB_PREFIX = lib
178 LIB_SUFFIX = .a
179 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
180 #
181
182 STRIPDEBUG=true #replace to do stripping of certain objects
183