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)
99 # ugh, but it gets hairy without extension..
103 LILYPOND_ROOTDIR=$(shell cd $(depth)/..; pwd)
106 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
107 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
108 # NO_DOOS_DIST = bin flower lib lily make mi2mu out
109 NO_DOOS_DIST = flower lib lily make mi2mu out
112 # list of object files:
114 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
115 OFILEC = $(SOURCE_FILES:.c=.o)
116 OFILECC = $(OFILEC:.cc=.o)
117 OFILEL = $(OFILECC:.ll=.o)
118 OFILEY = $(OFILEL:.yy=.o)
119 OFILES = $(addprefix $(outdir)/,$(OFILEY))
125 $(flowerout)/dummy.dep\
127 $(lilyout)/dummy.dep\
128 $(mi2muout)/dummy.dep\
134 ERROR_LOG = 2> /dev/null
135 SILENT_LOG = 2>&1 > /dev/null
136 date = $(shell date +%x)
140 lily-version = $(lilyout)/version.hh
141 flower-version = $(flowerout)/version.hh
142 mi2mu-version = $(mi2muout)/version.hh
147 LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
148 LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
151 # compile and link options:
154 CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
156 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
157 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
159 # -pipe makes it go faster, but is not supported on all platforms.
160 # EXTRA_CXXFLAGS= -Wall -Winline -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
161 EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
163 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
164 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
165 CXX_OUTPUT_OPTION = $< -o $@
166 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(outdir) -L$(depth)/flower/$(outdir)
167 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lstdc++ # need lg++ for win32, really!
178 AR_COMMAND = $(AR) $(ARFLAGS) $@
180 RANLIB_COMMAND=$(RANLIB) $@
184 DO_CXX_COMPILE=$(DODEP)\
185 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
190 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
195 depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))#
196 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
205 # generic target names:
208 EXECUTABLE = $(outdir)/$(NAME)$(EXE)
213 EXECUTABLES = $(EXECUTABLE)
220 LIBRARY = $(outdir)/$(LIB_PREFIX)$(NAME).a
221 SHAREDLIBRARY=$(outdir)/$(LIB_PREFIX)$(NAME).so
224 #replace to do stripping of certain objects
227 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
228 DOCDIR=$(depth)/$(outdir)
230 pod2groff=$(POD2MAN) --center="LilyPond documentation" --section="0"\
231 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
234 STRIP=strip --strip-debug
236 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
239 # substitute $(STRIP) in Site.make if you want stripping
243 LOOP=set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
248 sed-version= sed 's!@TOPLEVEL_VERSION@!${TOPLEVEL_VERSION}!g'