2 # project LilyPond -- the musical typesetter
3 # title generic variables
4 # file make/Variables.make
5 # abstract do not change this file for site-wide extensions;
6 # please edit settings in User.make
8 # Copyright (c) 1997 by
9 # Jan Nieuwenhuizen <jan@digicash.com>
10 # Han-Wen Nienhuys <hanwen@stack.nl>
12 # toplevel version info, might be handy?
14 include ./$(depth)/.version
16 include ./$(depth)/make/out/Configure_variables.make
19 # leave me up here, or i won-t work
23 MAKE:=$(MAKE) --no-builtin-rules
29 outdir = out# "objects" won-t do, used for libs and deps as well
30 lily_bindir = ./$(depth)/bin
31 distdir = ./$(depth)/$(DIST_NAME)
32 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
34 flowerout = ./$(depth)/flower/$(outdir)
35 libout = ./$(depth)/lib/$(outdir)
37 lilyout = ./$(depth)/lily/$(outdir)
38 mi2muout = ./$(depth)/mi2mu/$(outdir)
39 makeout = ./$(depth)/make/$(outdir)
40 doc-dir = ./$(depth)/Documentation
41 flower-dir = ./$(depth)/flower
42 lib-dir = ./$(depth)/lib
43 lily-dir = ./$(depth)/lily
44 mi2mu-dir = ./$(depth)/mi2mu
45 make-dir = ./$(depth)/make
46 include-lib = ./$(depth)/lib/include
47 include-flower = ./$(depth)/flower/include
49 rpm-sources = /usr/src/redhat/SOURCES
54 include ./$(depth)/make/User.make
57 # need to be defined in local Makefiles:
58 # build = ./$(depth)/lily/$(outdir)/.build ######## UGR!
59 BUILD = $(shell cat $(build))
60 INCREASE_BUILD = echo `expr \`cat $(build)\` + 1` > .b; mv .b $(build)
65 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(MY_PATCH_LEVEL)
66 TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)$(TOPLEVEL_MY_PATCH_LEVEL)
70 # module and top level dist:
72 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
73 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
74 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
77 # list of object files:
79 SOURCE_FILES = $(CCFILES) $(EXTRA_SOURCE_FILES)
80 OFILEC = $(SOURCE_FILES:.c=.o)
81 OFILECC = $(OFILEC:.cc=.o)
82 OFILEL = $(OFILECC:.l=.o)
83 OFILEY = $(OFILEL:.y=.o)
84 OFILES = $(patsubst %,$(outdir)/%,$(OFILEY))
90 $(flowerout)/dummy.dep\
93 $(mi2muout)/dummy.dep\
99 ERROR_LOG = 2> /dev/null
100 SILENT_LOG = >& /dev/null
101 allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu
102 allhh := $(shell $(FIND) -name "*.hh" $(ERROR_LOG))
103 allcc := $(shell $(FIND) -name "*.cc" $(ERROR_LOG))
104 allobs := $(shell $(FIND) $(outdir) -name "*.o" $(ERROR_LOG))
105 allibs := $(shell $(FIND) $(libdir) -name "*.lib" $(ERROR_LOG))
106 alldeps := $(shell $(FIND) $(outdir) -name "*.dep" $(ERROR_LOG))
110 lily-version = $(lilyout)/version.hh
111 flower-version = $(flowerout)/version.hh
112 mi2mu-version = $(mi2muout)/version.hh
117 LIBFLOWER = $(depth)/flower/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
118 LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
121 # compile and link options:
124 CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
125 CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS)
126 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout)
127 CXX_OUTPUT_OPTION = $< -o $@
128 LDFLAGS = $(EXTRA_LDFLAGS)
129 LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES) -lg++ # need lg++ for win32, really!
135 AR_COMMAND = $(AR) $(ARFLAGS) $@
137 RANLIB_COMMAND=$(RANLIB) $@
141 DO_CXX_COMPILE=$(DODEP)\
142 $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
150 LD_COMMAND = $(LD) $(LDFLAGS) -o $@
155 depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@))
156 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
165 # generic target names:
167 EXECUTABLE = $(NAME)$(EXE)
170 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
173 STRIPDEBUG=true #replace to do stripping of certain objects
175 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
176 DOCDIR=$(depth)/$(outdir)
178 # .hh should be first. Don't know why
179 progdocs=$(shell find -name '*.hh' |egrep -v 'obsolete/|out/') $(shell find -name '*.cc'|egrep -v 'out/|obsolete/')
180 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
181 --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
182 STRIP=strip --strip-debug
184 STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))