2 # project LilyPond -- the musical typesetter
3 # title generic variables
4 # file make/Variables.make
7 # do not change this file for site-wide extensions; please use
9 # Any change in files in this directory (make/) would be distributed.
11 # Copyright (c) 1997 by
12 # Jan Nieuwenhuizen <jan@digicash.com>
13 # Han-Wen Nienhuys <hanwen@stack.nl>
15 # toplevel version info, might be handy?
17 include $(depth)/VERSION
20 MAKE:=$(MAKE) --no-builtin-rules
27 top-directory := $(shell cd $(depth); pwd)
28 abs-sub-directory := $(shell pwd)
29 relative-sub-directory := $(subst $(top-directory),,$(abs-sub-directory))
30 outdir=$(buildprefix)/$(relative-sub-directory)/out/
37 lily_bindir = $(depth)/bin
38 distdir = $(depth)/$(DIST_NAME)
39 module-distdir = $(depth)/$(MODULE_DIST_NAME)
42 flowerout = $(buildprefix)/flower/out
43 libout = $(buildprefix)/lib/out
44 lilyout = $(buildprefix)/lily/out
45 mi2muout = $(buildprefix)/mi2mu/out
46 makeout = $(buildprefix)/make/out
47 docout = $(buildprefix)/Documentation/out
48 binout = $(buildprefix)/bin/out
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
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)
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)
90 # list of object files:
92 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
93 OFILEC = $(SOURCE_FILES:.c=.o)
94 OFILECC = $(OFILEC:.cc=.o)
95 OFILEL = $(OFILECC:.l=.o)
96 OFILEY = $(OFILEL:.y=.o)
97 OFILES = $(addprefix $(outdir)/,$(OFILEY))
103 $(flowerout)/dummy.dep\
105 $(lilyout)/dummy.dep\
106 $(mi2muout)/dummy.dep\
112 ERROR_LOG = 2> /dev/null
113 SILENT_LOG = 2>&1 > /dev/null
114 date = $(shell date +%x)
118 lily-version = $(lilyout)/version.hh
119 flower-version = $(flowerout)/version.hh
120 mi2mu-version = $(mi2muout)/version.hh
125 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
126 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
129 # compile and link options:
132 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
134 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
135 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
137 # -pipe makes it go faster, but is not supported on all platforms.
138 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
141 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
142 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
143 CXX_OUTPUT_OPTION = $< -o $@
144 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/out -L$(depth)/flower/out
145 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
151 AR_COMMAND = $(AR) $(ARFLAGS) $@
153 RANLIB_COMMAND=$(RANLIB) $@
157 DO_CXX_COMPILE=$(DODEP)\
158 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
166 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
171 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))
172 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
181 # generic target names:
183 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
184 EXECUTABLES = $(EXECUTABLE)
191 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
194 #replace to do stripping of certain objects
197 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
198 DOCDIR=$(depth)/$(outdir)
200 # .hh should be first. Don't know why
201 # take some trouble to auto ignore sources and obsolete stuff.
202 progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v 'out/') $(shell $(FIND) ./ -name '*.cc'|egrep -v 'out/')
206 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
207 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
210 STRIP=strip --strip-debug
212 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
215 # substitute $(STRIP) in Site.make if you want stripping