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
19 include ./$(depth)/make/out/Configure_variables.make
22 MAKE:=$(MAKE) --no-builtin-rules
27 outdir = out# "objects" won-t do, used for libs and deps as well
28 lily_bindir = ./$(depth)/bin
29 distdir = ./$(depth)/$(DIST_NAME)
30 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
32 flowerout = ./$(depth)/flower/$(outdir)
33 libout = ./$(depth)/lib/$(outdir)
34 lilyout = ./$(depth)/lily/$(outdir)
35 mi2muout = ./$(depth)/mi2mu/$(outdir)
36 makeout = ./$(depth)/make/$(outdir)
37 doc-dir = ./$(depth)/Documentation
38 flower-dir = ./$(depth)/flower
39 lib-dir = ./$(depth)/lib
40 lily-dir = ./$(depth)/lily
41 mi2mu-dir = ./$(depth)/mi2mu
42 make-dir = ./$(depth)/make
43 include-lib = ./$(depth)/lib/include
44 include-flower = ./$(depth)/flower/include
46 rpm-sources = ${HOME}/rpms/SOURCES
51 include ./$(depth)/make/User.make
54 # need to be defined in local Makefiles:
55 # build = ./$(depth)/lily/$(outdir)/.build ######## UGR!
56 BUILD = $(shell cat $(build))
57 INCREASE_BUILD = echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
62 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
63 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
67 # module and top level dist:
69 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
70 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
71 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
74 # list of object files:
76 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
77 OFILEC = $(SOURCE_FILES:.c=.o)
78 OFILECC = $(OFILEC:.cc=.o)
79 OFILEL = $(OFILECC:.l=.o)
80 OFILEY = $(OFILEL:.y=.o)
81 OFILES = $(addprefix $(outdir)/,$(OFILEY))
87 $(flowerout)/dummy.dep\
90 $(mi2muout)/dummy.dep\
96 ERROR_LOG = 2> /dev/null
97 SILENT_LOG = >& /dev/null
98 allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu
99 allhh := $(shell $(FIND) -name "*.hh" $(ERROR_LOG))
100 allcc := $(shell $(FIND) -name "*.cc" $(ERROR_LOG))
101 allobs := $(shell $(FIND) $(outdir) -name "*.o" $(ERROR_LOG))
103 alldeps := $(shell $(FIND) $(outdir) -name "*.dep" $(ERROR_LOG))
107 lily-version = $(lilyout)/version.hh
108 flower-version = $(flowerout)/version.hh
109 mi2mu-version = $(mi2muout)/version.hh
114 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
115 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
118 # compile and link options:
121 CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
123 # added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
124 # huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
125 EXTRA_CXXFLAGS=-pipe -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
128 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
129 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
130 CXX_OUTPUT_OPTION = $< -o $@
131 LDFLAGS = $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L $(depth)/lib/out -L $(depth)/flower/out
132 LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
138 AR_COMMAND = $(AR) $(ARFLAGS) $@
140 RANLIB_COMMAND=$(RANLIB) $@
144 DO_CXX_COMPILE=$(DODEP)\
145 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
153 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
158 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@))
159 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
168 # generic target names:
170 EXECUTABLE = $(NAME)$(EXE)
177 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
180 STRIPDEBUG=true #replace to do stripping of certain objects
182 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
183 DOCDIR=$(depth)/$(outdir)
185 # .hh should be first. Don't know why
186 # take some trouble to auto sources and obsolete stuff.
187 progdocs=$(shell find -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
191 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
192 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
195 STRIP=strip --strip-debug
197 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
200 # substitute $(STRIP) if you want stripping