]> git.donarmstrong.com Git - lilypond.git/blobdiff - make/Variables.make
release: 0.1.25
[lilypond.git] / make / Variables.make
index 3c74750c92573be8a0f448b0d4e0174305c4f475..37b1127741ff4abc5b30268af361771cdfbc5ece 100644 (file)
@@ -2,8 +2,13 @@
 # project  LilyPond -- the musical typesetter
 # title           generic variables
 # file    make/Variables.make
-# abstract do not change this file for site-wide extensions;
-# please edit settings in User.make 
+# abstract 
+#
+# do not change this file for site-wide extensions; please use 
+# make/$(OUTDIR_NAME)/Site.make; 
+#
+# Any change in files in this directory (make/) would be distributed, if 
+# you do make dist 
 #
 # Copyright (c) 1997 by    
 #      Jan Nieuwenhuizen <jan@digicash.com>
 
 # toplevel version info, might be handy?
 #
-include ./$(depth)/.version
-#
-include ./$(depth)/make/out/Configure_variables.make
+include $(depth)/VERSION
+
 
 ifeq (0,${MAKELEVEL})
+
+# Don't try to outsmart us, you puny computer!
 MAKE:=$(MAKE) --no-builtin-rules
 endif
 
+ifndef OUTDIR_NAME
+OUTDIR_NAME=out
+endif
 
 # directory names:
-#
-outdir = out# "objects" won-t do, used for libs and deps as well
-lily_bindir = ./$(depth)/bin
-distdir = ./$(depth)/$(DIST_NAME)
-module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
+buildprefix=$(depth)
+outdir=$(OUTDIR_NAME)
+
+# derived names
+lily_bindir = $(depth)/bin
+distdir = $(depth)/$(outdir)/$(DIST_NAME)
+module-distdir = $(depth)/$(MODULE_DIST_NAME)
 depdir = $(outdir)
-flowerout = ./$(depth)/flower/lib/$(outdir)
-libout = ./$(depth)/lib/$(outdir)
-libdir = $(outdir)
-lilyout = ./$(depth)/lily/$(outdir)
-mi2muout = ./$(depth)/mi2mu/$(outdir)
-makeout = ./$(depth)/make/$(outdir)
-flower-dir = ./$(depth)/flower/lib
-lib-dir = ./$(depth)/lib
-lily-dir = ./$(depth)/lily
-mi2mu-dir = ./$(depth)/mi2mu
-make-dir = ./$(depth)/make
-include-lib = ./$(depth)/lib/include
-include-flower = ./$(depth)/flower/lib/include
+
+flowerout = $(buildprefix)/flower/$(OUTDIR_NAME)
+libout = $(buildprefix)/lib/$(OUTDIR_NAME)
+lilyout = $(buildprefix)/lily/$(OUTDIR_NAME)
+mi2muout = $(buildprefix)/mi2mu/$(OUTDIR_NAME)
+makeout = $(buildprefix)/make/$(OUTDIR_NAME)
+docout = $(buildprefix)/Documentation/$(OUTDIR_NAME)
+binout = $(buildprefix)/bin/$(OUTDIR_NAME)
+
+doc-dir = $(depth)/Documentation
+flower-dir = $(depth)/flower
+lib-dir = $(depth)/lib
+lily-dir = $(depth)/lily
+mi2mu-dir = $(depth)/mi2mu
+make-dir = $(depth)/make
+include-lib = $(depth)/lib/include
+include-flower = $(depth)/flower/include
+
+
+rpm-sources = ${HOME}/rpms/SOURCES
 #
 
+include $(makeout)/Configure_variables.make
+
 # user settings:
 #
-include ./$(depth)/make/User.make
+include $(depth)/make/User.make
 #
 #
 # need to be defined in local Makefiles:
@@ -65,6 +85,7 @@ TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_
 # fix naming, use TOPLEVEL_ prefix _or_ MODULE?
 MODULE_DIST_NAME = $(MODULE_NAME)-$(VERSION)
 DIST_NAME = lilypond-$(TOPLEVEL_VERSION)
+NO_DOOS_DIST = bin flower lib lily make mi2mu out
 #
 
 # list of object files:
@@ -74,7 +95,7 @@ OFILEC = $(SOURCE_FILES:.c=.o)
 OFILECC = $(OFILEC:.cc=.o)
 OFILEL = $(OFILECC:.l=.o)
 OFILEY = $(OFILEL:.y=.o)
-OFILES = $(patsubst %,$(outdir)/%,$(OFILEY))
+OFILES = $(addprefix $(outdir)/,$(OFILEY))
 #
 
 # dummydeps
@@ -90,12 +111,8 @@ DUMMYDEPS=\
 # clean file lists:
 #
 ERROR_LOG = 2> /dev/null
-SILENT_LOG = >& /dev/null
-allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu
-allcc := $(shell $(FIND) -name "*.cc" $(ERROR_LOG))
-allobs := $(shell $(FIND) $(outdir) -name "*.o" $(ERROR_LOG))
-allibs := $(shell $(FIND) $(libdir) -name "*.lib" $(ERROR_LOG))
-alldeps := $(shell $(FIND) $(outdir) -name "*.dep" $(ERROR_LOG))
+SILENT_LOG = 2>&1 >  /dev/null
+date = $(shell date +%x)
 
 # version stuff:
 #
@@ -106,19 +123,27 @@ mi2mu-version = $(mi2muout)/version.hh
 
 # custom libraries:
 #
-LIBFLOWER = $(depth)/flower/lib/$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
-LIBLILY = $(depth)/lib/$(outdir)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
+LIBFLOWER = $(flowerout)/$(LIB_PREFIX)flower$(LIB_SUFFIX)
+LIBLILY = $(libout)/$(LIB_PREFIX)lily$(LIB_SUFFIX)
 #
 
 # compile and link options:
 #
 ARFLAGS = ru
-CFLAGS = $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
-CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS)
+CFLAGS = $(ICFLAGS) $(DEFINES) $(INCLUDES) $(USER_CFLAGS) $(EXTRA_CFLAGS)
+
+# added two warnings that are treated by cygwin32's gcc 2.7.2 as errors.
+# huh, but still, no warnings even provoced with linux's gcc 2.7.2.1?
+
+# -pipe makes it go faster, but is not supported on all platforms. 
+EXTRA_CXXFLAGS= -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wconversion
+
+
+CXXFLAGS = $(CFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
 INCLUDES = -Iinclude -I$(outdir) -I$(include-lib) -I$(libout) -I$(include-flower) -I$(flowerout) 
 CXX_OUTPUT_OPTION = $< -o $@
-LDFLAGS = $(EXTRA_LDFLAGS)
-LOADLIBES = $(EXTRA_LIBES) $(CUSTOMLIBES) -lg++
+LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) -L$(depth)/lib/$(OUTDIR_NAME) -L$(depth)/flower/$(OUTDIR_NAME)
+LOADLIBES = $(EXTRA_LIBES) $(MODULE_LIBES) -lg++ # need lg++ for win32, really!
 #
 
 # librarian:
@@ -129,9 +154,9 @@ AR_COMMAND = $(AR) $(ARFLAGS) $@
 RANLIB_COMMAND=$(RANLIB) $@
 # compiler:
 #
-# "CC = $(CC)"
-# "CXX = $(CXX)"
-#
+
+DO_CXX_COMPILE=$(DODEP)\
+       $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
 
 # linker:
 #
@@ -141,7 +166,7 @@ LD_COMMAND = $(LD) $(LDFLAGS) -o $@
 
 # dependencies:
 #
-depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@)) 
+depfile = $(depdir)/$(subst .o,.dep,$(notdir $@)) 
 DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
 #
 
@@ -153,11 +178,39 @@ DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
 
 # generic target names:
 #
-EXECUTABLE = $(NAME)$(EXE)
+ifdef NAME
+EXECUTABLE = $(outdir)/$(NAME)$(EXE)
+else
+EXECUTABLE =
+endif
+
+EXECUTABLES = $(EXECUTABLE)
 LIB_PREFIX = lib
+
+ifndef LIB_SUFFIX
 LIB_SUFFIX = .a
+endif
+
 LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
 #
 
-STRIPDEBUG=true #replace to do stripping of certain objects
+#replace to do stripping of certain objects
+STRIPDEBUG=true 
+
+DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
+DOCDIR=$(depth)/$(outdir)
+
+pod2html=pod2html
+pod2groff=pod2man --center="LilyPond documentation" --section="0"\
+       --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
+
+
+STRIP=strip --strip-debug
+ifdef stablecc
+ STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
+endif
+
+# substitute $(STRIP) in Site.make if you want stripping
+DO_STRIP=true
+