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
8 # make/$(outdir)/Site.make;
10 # Any change in files in this directory (make/) would be distributed, if
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)/make/Toplevel_version.make
22 # Don't try to outsmart us, you puny computer!
24 MAKE:=$(MAKE) --no-builtin-rules
31 configuration=config-$(config)
34 include $(depth)/$(configuration).make
40 outdir=out-$(CONFIGSUFFIX)
46 lily_bindir = $(depth)/bin
47 distdir = $(depth)/$(outdir)/$(DIST_NAME)
50 flowerout = $(buildprefix)/flower/$(outdir)
51 libout = $(buildprefix)/lib/$(outdir)
52 lilyout = $(buildprefix)/lily/$(outdir)
53 mi2muout = $(buildprefix)/mi2mu/$(outdir)
54 makeout = $(buildprefix)/make/$(outdir)
55 docout = $(buildprefix)/Documentation/$(outdir)
56 binout = $(buildprefix)/bin/$(outdir)
58 doc-dir = $(depth)/Documentation
59 flower-dir = $(depth)/flower
60 lib-dir = $(depth)/lib
61 lily-dir = $(depth)/lily
62 mi2mu-dir = $(depth)/mi2mu
63 make-dir = $(depth)/make
64 include-lib = $(depth)/lib/include
65 include-flower = $(depth)/flower/include
68 rpm-sources = ${HOME}/rpms/SOURCES
71 configheader=$(outdir)/config.hh
78 include $(depth)/make/User.make
81 # need to be defined in local Makefiles:
86 ifneq ($(MY_PATCH_LEVEL),$(FOOBAR))
87 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL).$(MY_PATCH_LEVEL)
89 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
92 ifneq ($(TOPLEVEL_MY_PATCH_LEVEL),$(FOOBAR))
93 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL).$(TOPLEVEL_MY_PATCH_LEVEL)
95 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)
102 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
103 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
104 NO_DOOS_DIST = bin flower lib lily make mi2mu out
107 # list of object files:
109 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
110 OFILEC = $(SOURCE_FILES:.c=.o)
111 OFILECC = $(OFILEC:.cc=.o)
112 OFILEL = $(OFILECC:.ll=.o)
113 OFILEY = $(OFILEL:.yy=.o)
114 OFILES = $(addprefix $(outdir)/,$(OFILEY))
120 $(flowerout)/dummy.dep\
122 $(lilyout)/dummy.dep\
123 $(mi2muout)/dummy.dep\
129 ERROR_LOG = 2> /dev/null
130 SILENT_LOG = 2>&1 > /dev/null
131 date = $(shell date +%x)
135 lily-version = $(lilyout)/version.hh
136 flower-version = $(flowerout)/version.hh
137 mi2mu-version = $(mi2muout)/version.hh
142 LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
143 LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
146 # compile and link options:
149 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
151 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
152 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
154 # -pipe makes it go faster, but is not supported on all platforms.
155 # EXTRA_CXXFLAGS= -fno-rtti -fno-exceptions -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
156 EXTRA_CXXFLAGS= -Wall -Winline -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
158 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
159 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
160 CXX_OUTPUT_OPTION = $< -o $@
161 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(outdir) -L$(depth)/flower/$(outdir)
162 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lstdc++ # need lg++ for win32, really!
173 AR_COMMAND = $(AR) $(ARFLAGS) $@
175 RANLIB_COMMAND=$(RANLIB) $@
179 DO_CXX_COMPILE=$(DODEP)\
180 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
185 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
190 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))#
191 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
200 # generic target names:
203 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
208 EXECUTABLES = $(EXECUTABLE)
215 LIBRARY = $(outdir)/$(LIB_PREFIX)$(NAME).a
216 SHAREDLIBRARY=$(outdir)/$(LIB_PREFIX)$(NAME).so
219 #replace to do stripping of certain objects
222 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
223 DOCDIR=$(depth)/$(outdir)
225 pod2groff=$(POD2MAN) --center="LilyPond documentation" --section="0"\
226 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
229 STRIP=strip --strip-debug
231 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
234 # substitute $(STRIP) in Site.make if you want stripping
238 LOOP=set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done