2005-10-19 Jan Nieuwenhuizen <janneke@gnu.org>
+ * stepmake/stepmake/*:
+ * */GNUmakefile:
+ * config.make.in:
+ * GNUmakefile.in:
+ * stepmake/aclocal.m4: Friendlier --srcdir build, allowing `make'
+ from any directory in build-dir. Cleanups.
+
+ * make/srcdir.make.in: Remove.
+
+ * lily/main.cc (setup_paths): Fix and document build-dir hack.
+
* SConstruct (CheckYYCurrentBuffer): Use TryCompile (there is no
main).
rm -rf $(outdir)/wiki-dump
copy-for-me:
- $(foreach a, $(README_TOP_FILES), cp ../$(a) $(outdir)/$(a).txt && ) true
+ $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
depth=../..
-LATEX_FILES =$(wildcard *.latex)
+LATEX_FILES =$(call src-wildcard,*.latex)
# todo: add latex.
DVI_FILES = $(TELY_FILES:%.tely=$(outdir)/%.dvi)
EXTRA_DIST_FILES= $(LATEX_FILES) $(IMAGES)
-IMAGES=$(wildcard *.png)
+IMAGES=$(call src-wildcard,*.png)
OUT_EPS_IMAGES=$(IMAGES:%.png=$(outdir)/%.eps)
OUT_PNG_IMAGES=$(IMAGES:%=$(outdir)/%)
LOCALSTEPMAKE_TEMPLATES=lilypond ly
-TEXINPUTS=$(topdir)/tex::
+TEXINPUTS=$(top-src-dir)/tex::
export TEXINPUTS
include $(depth)/make/stepmake.make
endif
# All web targets, except info image symlinks and info docs are
-# installed in non-recursing target from TOPDIR
+# installed in non-recursing target from TOP-SRC-DIR
local-install-WWW: local-install-info
local-uninstall-WWW: local-uninstall-info
#
$(outdir)/lilypond/index.html: $(outdir)/lilypond.texi $(OUT_PNG_IMAGES)
mkdir -p $(dir $@)
- $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
+ $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
find $(outdir)/lilypond/ -name '*'.png -o -name '*'.ly | xargs rm -f
# symbolic links to save space
(cd $(outdir)/lilypond/ ; ln -sf ../*.png ../*.ly . )
# One big page manual
#
$(outdir)/lilypond.html: $(outdir)/lilypond.texi
- $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
+ $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
#
# The split internals reference
#
$(outdir)/lilypond-internals/index.html: $(outdir)/lilypond-internals.texi
mkdir -p $(dir $@)
- $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
+ $(MAKEINFO) --output=$(outdir)/lilypond-internals --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
#
# One big page internals reference
#
$(outdir)/lilypond-internals.html: $(outdir)/lilypond-internals.texi
- $(MAKEINFO) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
+ $(MAKEINFO) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
#
# The split glossary
#
$(outdir)/music-glossary/index.html: $(outdir)/music-glossary.texi
mkdir -p $(dir $@)
- $(MAKEINFO) --output=$(outdir)/music-glossary --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
+ $(MAKEINFO) --output=$(outdir)/music-glossary --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
find $(outdir)/music-glossary/ -name '*'.png -o -name '*'.ly | xargs rm -f
# symbolic links to save space
(cd $(outdir)/music-glossary/ ; ln -sf ../*.png ../*.ly . )
rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals $(outdir)/music-glossary
# lilypond.texi deps
-$(builddir)/mf/$(outconfbase)/feta16list.ly:
- $(MAKE) -C $(topdir)/mf
+$(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
+ $(MAKE) -C $(top-src-dir)/mf
$(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES)
$(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
# of lilypond-internals every time. however, this triggers
# compilation during install, which is a bad thing (tm).
-$(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond
- cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-documentation
+$(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(top-build-dir)/lily/$(outconfbase)/lilypond
+ cd $(outdir) && $(top-build-dir)/lily/$(outconfbase)/lilypond --verbose $(top-src-dir)/ly/generate-documentation
rm -f $(outdir)/lilypond-internals.nexi
-ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
## unused
$(outdir)/interfaces.itexi: dummy
- cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond $(abs-srcdir)/ly/generate-interface-doc
+ cd $(outdir) && $(top-build-dir)/lily/$(outconfbase)/lilypond $(top-src-dir)/ly/generate-interface-doc
else
local-clean: local-delete
local-delete:
- -for i in $$(seq 0 9); do \
- for j in dvi eps eps.bbox eps.trans eps.trans.ps ps log png tex; do \
- rm -f $(outdir)/lily-$$i*$$j; \
- done; \
- done
+ find $(outdir)/ -name 'lily-[0-9]*' | xargs rm -f
-rm -f $(outdir)/*
#package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
SCRIPTS = configure aclocal.m4 autogen.sh lexer-gcc-3.1.sh Doxyfile
-README_FILES = ChangeLog COPYING DEDICATION ROADMAP THANKS HACKING
+README_FILES = ChangeLog COPYING DEDICATION ROADMAP THANKS HACKING
README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt NEWS.txt
-IN_FILES := $(wildcard *.in)
+IN_FILES := $(call src-wildcard,*.in)
PATCH_FILES = emacsclient.patch server.el.patch darwin.patch
EXTRA_DIST_FILES = VERSION .cvsignore SConstruct \
$(README_FILES) $(SCRIPTS) $(IN_FILES) $(PATCH_FILES)
local-WWW-post:
# need UTF8 setting in case this is hosted on a website.
- echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(builddir)/.htaccess
- $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(builddir)/examples.html ./
- cd $(builddir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
- cd $(builddir) && find . -name \*.html~ -print | xargs rm -f
- cd $(builddir) && find Documentation input \
+ echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(top-build-dir)/.htaccess
+ $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(top-build-dir)/examples.html ./
+ cd $(top-build-dir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
+ cd $(top-build-dir) && find . -name \*.html~ -print | xargs rm -f
+ cd $(top-build-dir) && find Documentation input \
$(web-ext:%=-path '*/out-www/*.%' -or) -type l \
> $(outdir)/weblist
- echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/out-www/index.html">' > $(builddir)/index.html
- echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(builddir)/index.html
- cd $(builddir) && ls *.html >> $(outdir)/weblist
- cat $(outdir)/weblist | (cd $(builddir); GZIP=-9v tar -czf $(outdir)/web.tar.gz -T -)
+ echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/out-www/index.html">' > $(top-build-dir)/index.html
+ echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(top-build-dir)/index.html
+ cd $(top-build-dir) && ls *.html >> $(outdir)/weblist
+ cat $(outdir)/weblist | (cd $(top-build-dir); GZIP=-9v tar -czf $(outdir)/web.tar.gz -T -)
-share-prefix = $(builddir)/share
-tree-prefix = $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)
+share-prefix = $(top-build-dir)/share
+tree-prefix = $(top-build-dir)/share/lilypond/$(TOPLEVEL_VERSION)
src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh
$(MAKE) out=www clean
$(MAKE) $(tree-prefix)/lilypond-force
-default: $(config_h) builddir-setup
+default: $(config_h) build-dir-setup
-builddir-setup: $(tree-prefix)/lilypond-force
+build-dir-setup: $(tree-prefix)/lilypond-force
-PO_FILES = $(wildcard $(srcdir)/po/*.po)
-HELP_CATALOGS = $(PO_FILES:$(srcdir)/po/%.po=%)
+PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
+HELP_CATALOGS = $(PO_FILES:$(src-depth)/po/%.po=%)
CATALOGS = $(HELP_CATALOGS:lilypond=)
$(tree-prefix)/lilypond-force link-tree: GNUmakefile
-# Preparing LilyPond tree for builddir exec
- cd $(builddir) && rm -rf lib share
- mkdir -p $(builddir)/lib/$(package)
+# Preparing LilyPond tree for build-dir exec
+ cd $(top-build-dir) && rm -rf lib share
+ mkdir -p $(top-build-dir)/lib/$(package)
mkdir -p $(tree-prefix)
mkdir -p $(tree-prefix)/dvips
mkdir -p $(tree-prefix)/elisp
mkdir -p $(tree-prefix)/fonts/map
mkdir -p $(tree-prefix)/fonts/enc
mkdir -p $(tree-prefix)/tex
- cd $(builddir)/lib && \
+ cd $(top-build-dir)/lib && \
ln -s ../../../python/$(outconfbase) python
cd $(tree-prefix) && \
- ln -s $(abs-srcdir)/ly ly && \
- ln -s $(abs-srcdir)/ps && \
+ ln -s $(top-src-dir)/ly ly && \
+ ln -s ../../../mf mf && \
+ ln -s $(top-src-dir)/ps && \
ln -s ../../../python/$(outconfbase) python && \
- ln -s $(abs-srcdir)/scm && \
- ln -s $(abs-srcdir)/scripts scripts
+ ln -s $(top-src-dir)/scm && \
+ ln -s $(top-src-dir)/scripts scripts
cd $(tree-prefix)/dvips && \
ln -s ./../../mf/$(outconfbase) mf-out && \
- ln -s $(abs-srcdir)/ps
+ ln -s $(top-src-dir)/ps
cd $(tree-prefix)/tex && \
- ln -s $(abs-srcdir)/tex source && \
+ ln -s $(top-src-dir)/tex source && \
ln -s ../../../../tex/$(outconfbase) tex-out && \
ln -s ../../../../mf/$(outconfbase) mf-out
-cd $(tree-prefix)/fonts/otf && \
-cd $(tree-prefix)/fonts/type1 && \
ln -s ../../../../../mf/$(outconfbase)/*.pfa .
cd $(tree-prefix)/fonts && \
- ln -s $(abs-srcdir)/mf source && \
+ ln -s $(top-src-dir)/mf source && \
true
-cd $(tree-prefix)/elisp && \
ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \
- ln -s $(abs-srcdir)/elisp/*.el .
+ ln -s $(top-src-dir)/elisp/*.el .
$(foreach i,$(CATALOGS), \
mkdir -p $(share-prefix)/locale/$i/LC_MESSAGES && \
cd $(share-prefix)/locale/$i/LC_MESSAGES && \
# touch $@
touch $(tree-prefix)/lilypond-force
-local-clean: builddir-setup-clean
-builddir-setup-clean:
- cd $(builddir) && rm -rf share
+local-clean: build-dir-setup-clean
+build-dir-setup-clean:
+ cd $(top-build-dir) && rm -rf share
$(config_h): config.hh.in
#
fi
if test -z "$*"; then
- echo "warning: about to run \`./configure' without arguments."
- echo "arguments on the \`$0\'"
- echo "command line will be passed to \`./configure'."
- echo
+ cat <<EOF
+ Warning: about to run \`configure' without arguments.
+ arguments on the \`$0' command line
+ will be passed to \`configure'.
+
+ Invoke with --noconfigure to skip configure step.
+EOF
fi
echo Running $srcdir/configure $conf_flags "$@" ...
package-depth = @package_depth@
-USER_CFLAGS = @CPPFLAGS@ @CFLAGS@ @GUILE_CFLAGS@ @PANGO_FT2_CFLAGS@ @FREETYPE2_CFLAGS@
-USER_CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ @GUILE_CFLAGS@ @PANGO_FT2_CFLAGS@ @FREETYPE2_CFLAGS@
-USER_LDFLAGS = @LDFLAGS@ @GUILE_LDFLAGS@
-EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@ @PANGO_FT2_LIBS@ @FONTCONFIG_LIBS@ @FREETYPE2_LIBS@
+FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
+GTK2_CFLAGS = @GTK2_CFLAGS@
+GUILE_CFLAGS = @GUILE_CFLAGS@
+PANGO_FT2_CFLAGS = @PANGO_FT2_CFLAGS@
+
+CONFIG_CPPFLAGS = @CPPFLAGS@
+CONFIG_DEFINES = @DEFINES@
+
+CONFIG_CFLAGS = @CFLAGS@ $(GUILE_CFLAGS) $(FREETYPE2_CFLAGS) $(PANGO_FT2_CFLAGS)
+CONFIG_CXXFLAGS = @CXXFLAGS@ $(GUILE_CFLAGS) $(FREETYPE2_CFLAGS) $(PANGO_FT2_CFLAGS)
+
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
+GUILE_LIBS = @GUILE_LDFLAGS@
+GTK2_LIBS = @GTK2_LIBS@
+FREETYPE2_LIBS = @FREETYPE2_LIBS@
+PANGO_FT2_LIBS = @PANGO_FT2_LIBS@
+
+CONFIG_LIBS = @LIBS@ @EXTRA_LIBS@ $(GUILE_LIBS) $(PANGO_FT2_LIBS) $(FONTCONFIG_LIBS) $(FREETYPE2_LIBS)
+CONFIG_LDFLAGS = @LDFLAGS@
PACKAGE = @PACKAGE@
package = @package@
prefix = @prefix@
exec_prefix = @exec_prefix@
-builddir = @ugh_ugh_autoconf250_builddir@
+##configure-builddir = @ugh_ugh_autoconf250_builddir@
+configure-srcdir = @srcdir@
+
+bindir = @bindir@
build_lilypond_datadir = @build_package_datadir@
build_lilypond_libdir = @build_package_libdir@
-bindir = @bindir@
datadir = @datadir@
+docdir = $(datadir)/doc
+elispdir = $(datadir)/emacs/site-lisp
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
localedir = @localedir@
mandir = @mandir@
+omfdir = $(datadir)/omf
program_prefix = @program_prefix@
program_suffix = @program_suffix@
sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
stepmake = @stepmake@
-docdir = $(datadir)/doc
-omfdir = $(datadir)/omf
-elispdir = $(datadir)/emacs/site-lisp
package_datadir = $(datadir)/$(package)
package_infodir = $(infodir)/$(package)
DOTEXE = @DOTEXE@
FIND = @FIND@
FLEX = @FLEX@
+FLEXLEXER_PATH = @FLEXLEXER_PATH@
FONTFORGE = @FONTFORGE@
GCC = @GCC@
GROFF = @GROFF@
INSTALL = @INSTALL@
KPATHSEA_LIBS = @KPATHSEA_LIBS@
LD = @LD@
+LINK_GXX_STATICALLY = @LINK_GXX_STATICALLY@
LN = @LN@
LN_S = @LN_S@
MAKEINFO_PROGRAM = @MAKEINFO@
WINDRES = @WINDRES@
YACC = @YACC@
ZIP = @ZIP@
-FLEXLEXER_PATH = @FLEXLEXER_PATH@
-
-LINK_GXX_STATICALLY = @LINK_GXX_STATICALLY@
STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
if test "$gui_b" = "yes"; then
STEPMAKE_GTK2(gtk+-2.0, REQUIRED, 2.4.0)
-fi # $gui_b
+fi
if test "$reloc_b" = "yes"; then
AC_DEFINE(ARGV0_RELOCATION)
-fi # $reloc_b
+fi
-STEPMAKE_FREETYPE2(freetype2, REQUIRED, 0)
-#STEPMAKE_PANGO(pango, REQUIRED, 1.6.0)
STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
+#STEPMAKE_PANGO(pango, REQUIRED, 1.6.0)
STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.2.0)
+STEPMAKE_FREETYPE2(freetype2, REQUIRED, 0)
STEPMAKE_WINDOWS
Runtime requirements:
bash
cygwin-1.5.11 or newer
- ec-fonts-mftraced
ghostscript
glib2-runtime
libfontconfig1
libfreetype2
libguile12-1.6.5-1 or newer
libiconv2
- libintl2
- libkpathsea3-2.0.2-15 or newer
+ libintl3
pango-runtime
python
- tetex-bin-2.0.2-15 or newer
- tetex-tiny or tetex-base
Suggested:
xorg-x11-base
emacs or vim
ghostscript-x11
rxvt
- tetex-x11
+ libkpathsea4-3.0.0-3 or newer
gv
Build requirements:
libfontconfig-devel
libfreetype2-devel
libguile12-1.6.5-1 or newer
- libkpathsea3-2.0.2-15 or newer
+ libkpathsea4-3.0.0-3 or newer
pango-devel
python
sed
- tetex-devel-2.0.2-15 or newer
- texinfo-4.7 or newer
+ tetex-devel-3.0.0-3 or newer
+ texinfo-4.8 or newer
Website/documentation build requirements (lilypond-doc package):
LilyPond builds ootb with cygwin/mknetrel.
- Cygwin port maintained by: Bertalan Fodor
+ Cygwin port maintained by: Jan Nieuwenhuizen.
------------------
sdesc: "A program for printing sheet music"
category: Publishing
-requires: bash coreutils cygwin findutils ghostscript glib2-runtime libfontconfig1 libfreetype2 libguile12 libiconv2 libintl3 pango-runtime python _update-info-dir
-#suggests: emacs gsview lilypond-doc rxvt tetex-x11 xorg-x11-base libkpathsea4
+requires: bash coreutils cygwin findutils ghostscript glib2-runtime libfontconfig1 libfreetype26 libguile12 libiconv2 libintl3 pango-runtime python _update-info-dir
+#suggests: emacs gsview libkpathsea4 lilypond-doc tetex-bin tetex-tiny rxvt xorg-x11-base
ldesc: "A program for printing sheet music.
-LilyPond prints beautiful sheet music. It produces music notation
-from a description file. It excels at typesetting classical music, but
-you can also print pop-songs. LilyPond is part of the GNU Project."
+LilyPond lets you create music notation. It produces
+beautiful sheet music from a high-level description file."
LILYPOND_WORDS = $(outdir)/lilypond-words.el
LILYPOND_WORDS_DEPENDS =\
- $(topdir)/lily/lily-lexer.cc \
+ $(top-src-dir)/lily/lily-lexer.cc \
$(buildscript-dir)/lilypond-words.py \
- $(topdir)/scm/markup.scm \
- $(topdir)/ly/engraver-init.ly
+ $(top-src-dir)/scm/markup.scm \
+ $(top-src-dir)/ly/engraver-init.ly
$(LILYPOND_WORDS):
- cd $(topdir) && $(PYTHON) buildscripts/lilypond-words.py --el --dir=$(builddir)/elisp/$(outconfbase)
+ cd $(top-src-dir) && $(PYTHON) buildscripts/lilypond-words.py --el --dir=$(top-build-dir)/elisp/$(outconfbase)
all: $(LILYPOND_WORDS)
# for profiling, link guile statically:
#
-# USER_LDFLAGS += -static -lltdl -ldl
+# CONFIG_LDFLAGS += -static -lltdl -ldl
#
ifeq ($(PLATFORM_WINDOWS),yes)
$(outdir)/lilypond: $(outdir)/lilypond.rc.o
$(outdir)/lilypond.rc.o: $(outdir)/lilypond.ico $(outdir)/ly.ico
-$(builddir)/Documentation/pictures/$(outbase)/lilypond.ico:
- $(MAKE) -C $(abs-srcdir)/Documentation/pictures
-$(outdir)/lilypond.ico: $(builddir)/Documentation/pictures/$(outbase)/lilypond.ico
+$(top-build-dir)/Documentation/pictures/$(outbase)/lilypond.ico:
+ $(MAKE) -C $(top-src-dir)/Documentation/pictures
+$(outdir)/lilypond.ico: $(top-build-dir)/Documentation/pictures/$(outbase)/lilypond.ico
cp $< $@
-$(builddir)/Documentation/pictures/$(outbase)/ly.ico:
- $(MAKE) -C $(abs-srcdir)/Documentation/pictures
-$(outdir)/ly.ico: $(builddir)/Documentation/pictures/$(outbase)/ly.ico
+$(top-build-dir)/Documentation/pictures/$(outbase)/ly.ico:
+ $(MAKE) -C $(top-src-dir)/Documentation/pictures
+$(outdir)/ly.ico: $(top-build-dir)/Documentation/pictures/$(outbase)/ly.ico
cp $< $@
endif
# ugh. For --srcdir builds, these must exist to satisfy their broken
# lexer.dep and parser.dep file entries.
-ifneq ($(srcdir), .)
+ifneq ($(configure-srcdir),.)
.PRECIOUS: $(outdir)/lexer.cc $(outdir)/parser.cc
endif
+
+foe:
+ @echo b:$(build-dir)
+ @echo s:$(src-dir)
+ @echo t:$(tree-dir)
font_config_global = FcConfigGetCurrent ();
Array<String> dirs;
- struct stat statbuf;
- String builddir = prefix_directory + "/mf/out/";
-
- if (stat (builddir.to_str0 (), &statbuf) == 0)
- dirs.push (builddir.to_str0 ());
- else
- {
- dirs.push (prefix_directory + "/fonts/otf/");
- dirs.push (prefix_directory + "/fonts/type1/");
- dirs.push (prefix_directory + "/fonts/svg/");
- }
+ /*
+ ugh. C&P main.cc
+ */
+ dirs.push (prefix_directory + "/fonts/otf/");
+ dirs.push (prefix_directory + "/fonts/type1/");
+ dirs.push (prefix_directory + "/fonts/cff/");
+ dirs.push (prefix_directory + "/fonts/svg/");
+
for (int i = 0; i < dirs.size (); i++)
{
String dir = dirs[i];
return scm_cons (scm_from_int (n), scm_from_int (d));
}
-// Breaks for flex 2.5.31
-#if 0
-/* avoid silly flex induced gcc warnings */
-static void yy_push_state (int) {;}
-static void yy_pop_state () {;}
-static int yy_top_state () { return 0; }
-
-static void
-avoid_silly_flex_induced_gcc_warnings ()
-{
- (void)yy_start_stack_ptr;
- (void)yy_start_stack_depth;
- (void)yy_start_stack;
- yy_push_state (0);
- yy_pop_state ();
- yy_top_state ();
- avoid_silly_flex_induced_gcc_warnings ();
-}
-#endif
-
SCM
lookup_markup_command (String s)
{
}
/*
- ugh. C&P font-config.cc
+ When running from build dir, a full LILYPOND_PREFIX is set-up at
+
+ share/lilypond/TOPLEVEL_VERSION
+
+ This historical hack will allow the shorthand
+
+ LILYPONDPREFIX=. lily/out/lilypond ...
+
*/
struct stat statbuf;
- String builddir = prefix_directory + "/mf/out/";
- if (stat (builddir.to_str0 (), &statbuf) == 0)
- dirs.push (builddir.to_str0 ());
- else
- {
- dirs.push (prefix_directory + "/fonts/otf/");
- dirs.push (prefix_directory + "/fonts/type1/");
- dirs.push (prefix_directory + "/fonts/cff/");
- dirs.push (prefix_directory + "/fonts/svg/");
- dirs.push (prefix_directory + "/fonts/cff/");
- }
+ String build_prefix = prefix_directory + "share/lilypond/" TOPLEVEL_VERSION;
+ if (stat (build_prefix.to_str0 (), &statbuf) == 0)
+ prefix_directory = build_prefix;
+
+ dirs.push (prefix_directory + "/fonts/otf/");
+ dirs.push (prefix_directory + "/fonts/type1/");
+ dirs.push (prefix_directory + "/fonts/cff/");
+ dirs.push (prefix_directory + "/fonts/svg/");
for (int i = 0; i < dirs.size (); i++)
global_path.prepend (dirs[i]);
## settings to run LilyPond
# environment settings.
-export PATH:=$(builddir)/lily/$(outconfbase):$(builddir)/buildscripts/$(outconfbase):$(builddir)/scripts/$(outconfbase):$(PATH):
+export PATH:=$(top-build-dir)/lily/$(outconfbase):$(top-build-dir)/buildscripts/$(outconfbase):$(top-build-dir)/scripts/$(outconfbase):$(PATH):
export LILYPONDPREFIX:=$(build_lilypond_datadir)/$(TOPLEVEL_VERSION)
-export PYTHONPATH:=$(builddir)/python/$(outconfbase):$(PYTHONPATH)
-export DVIPSHEADERS:=$(builddir)/mf/out::
+export PYTHONPATH:=$(top-build-dir)/python/$(outconfbase):$(PYTHONPATH)
+export DVIPSHEADERS:=$(top-build-dir)/mf/out::
the-script-dir=$(wildcard $(script-dir))
ABC2LY = $(script-dir)/abc2ly.py
CONVERT_LY = $(script-dir)/convert-ly.py
-LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
+LILYPOND = $(top-build-dir)/lily/$(outconfbase)/lilypond
LILYPOND_BOOK = $(script-dir)/lilypond-book.py
-LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND) --backend=eps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -dinternal-type-checking -danti-alias-factor=2 -dgs-font-load"
+LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(top-build-dir)/mf/$(outconfbase)/ -I $(top-build-dir)/mf/out/
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND) --backend=eps --formats=ps,png --header=texidoc -I $(top-src-dir)/input/test -dinternal-type-checking -danti-alias-factor=2 -dgs-font-load"
#texi-html for www only:
$(outdir)/%.ly: %.abc
$(PYTHON) $(ABC2LY) --strict -o $@ $<
-# hmm. notdir builds srcdir builds?
+# hmm. notdir builds src-dir builds?
$(outdir)/%.png $(outdir)/%.pdf $(outdir)/%.ly $(outdir)/%.ps: $(outdir)/%.ly
cd $(outdir); $(LILYPOND) --pdf --png -danti-alias-factor=2 -ddelete-intermediate-files -dno-point-and-click -I $(shell pwd)/ $(notdir $<)
touch $(outdir)/$(basename $(notdir $<)).png
+++ /dev/null
-# -*-Makefile-*-
-# specific srcdir makefile for LilyPond
-
-depth=.
-
-# Don't try to outsmart us, you puny computer!
-ifeq (0,${MAKELEVEL})
- MAKE:=$(MAKE) --no-builtin-rules
-endif
-
-# Use alternate configurations alongside eachother:
-#
-# ./configure --enable-configsuffix=debug
-# make conf=debug
-#
-# uses config-debug.make and config-debug.h; output goes to out-debug.
-#
-ifdef conf
- CONFIGSUFFIX=-$(conf)
-endif
-
-# Use same configurations, but different output directory:
-#
-# make out=WWW
-#
-# uses config.make and config.h; output goes to out-WWW.
-#
-ifdef out
- outbase=out-$(out)
-else
- outbase=out$(CONFIGSUFFIX)
-endif
-
-config = config$(CONFIGSUFFIX).make
-
-include $(config)
-
-export SRCMAKE=$(MAKE) -C $(srcdir) -f GNUmakefile.in builddir=$(builddir)
-
-default: all
-
-%:
- $(SRCMAKE) $@
-
-web:
- $(SRCMAKE) out=www WWW
- $(SRCMAKE) out=www WWW-post
-
-web-install:
- $(SRCMAKE) out=www install-WWW
-
-install:
- $(SRCMAKE) install
- $(SRCMAKE) final-install
ifdef config
config_make=$(config)
else
- ifeq ($(builddir),)
- config_make=$(depth)/config$(CONFIGSUFFIX).make
- else
- config_make=$(builddir)/config$(CONFIGSUFFIX).make
- endif
+ config_make=$(depth)/config$(CONFIGSUFFIX).make
endif
-ifeq ($(builddir),)
- outroot=.
-else
- outroot=$(builddir)$(patsubst $(shell cd $(depth); pwd)%,%,$(pwd))
-endif
+outroot=.
include $(config_make)
outdir=$(outroot)/$(outbase)
# why not generic ??
-config_h=$(builddir)/config$(CONFIGSUFFIX).hh
+config_h=$(top-build-dir)/config$(CONFIGSUFFIX).hh
# The outdir that was configured for: best guess to find binaries
outconfbase=out$(CONFIGSUFFIX)
include $(addprefix $(stepdir)/,$(addsuffix -vars.make, $(STEPMAKE_TEMPLATES)))
-# ugh. need to do this because of PATH :=$(topdir)/..:$(PATH)
+# ugh. need to do this because of PATH :=$(top-src-dir)/..:$(PATH)
include $(addprefix $(depth)/make/,$(addsuffix -vars.make, $(LOCALSTEPMAKE_TEMPLATES)))
include $(addprefix $(stepdir)/,$(addsuffix -rules.make, $(STEPMAKE_TEMPLATES)))
include $(addprefix $(depth)/make/,$(addsuffix -targets.make, $(LOCALSTEPMAKE_TEMPLATES)))
include $(addprefix $(stepdir)/,$(addsuffix -targets.make, $(STEPMAKE_TEMPLATES)))
-
-
program_prefix\
program_suffix\
sharedstatedir\
- srcdir\
- step-bindir\
include $(depth)/make/stepmake.make
-AF_FILES = $(wildcard *.af)
+AF_FILES = $(call src-wildcard,*.af)
# hangs on feta23
MFTRACE_FLAGS= # --simplify
EXTRA_DIST_FILES += README feta.tex
# We don't use $(MF_FILES), because there's more .mf cruft here
-FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
- $(wildcard feta-braces-[a-z].mf)\
- $(wildcard feta-alphabet*[0-9].mf)\
- $(wildcard parmesan[0-9]*.mf)
+FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf)\
+ $(call src-wildcard,feta-braces-[a-z].mf)\
+ $(call src-wildcard,feta-alphabet*[0-9].mf)\
+ $(call src-wildcard,parmesan[0-9]*.mf)
STAFF_SIZES = 11 13 14 16 18 20 23 26
BRACES = a b c d e f g h i
FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
-ENCODING_FILE=$(findstring $(<:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
+ENCODING_FILE=$(findstring $(<F:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
# only for fonts which
$(outdir)/aybabtu.fontname:
echo -n 'aybabtu' > $@
$(outdir)/aybabtu.subfonts:
- echo $(subst .mf,,$(wildcard feta-braces-[a-z].mf)) > $@
+ echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
$(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
$(PYTHON) $< --dir=$(outdir)
.PHONY: tree-regen
# FIXME: temporary hack: must regenerate after building fonts
tree-regen:
- rm -rf $(builddir)/share
- ${MAKE} -C $(builddir) link-tree
+ rm -rf $(top-build-dir)/share
+ ${MAKE} -C $(top-build-dir) link-tree
default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
local-uninstall:
-rm -f $(DESTDIR)$(local_lilypond_datadir)/dvips/map
-rmdir $(DESTDIR)$(local_lilypond_datadir)/dvips
+
+foe:
+ @echo mf:$(FETA_MF_FILES)
\ No newline at end of file
include $(depth)/make/stepmake.make
# unset al guile stuff from configure
-USER_LDFLAGS=
+CONFIG_LDFLAGS=
INSTALLATION_OUT_SUFFIXES=1
fi
if test $profile_b = yes; then
- EXTRA_LIBES="-pg"
+ EXTRA_LIBS="-pg"
OPTIMIZE="$OPTIMIZE -pg"
fi
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
- AC_SUBST(ICFLAGS)
- AC_SUBST(ILDFLAGS)
AC_SUBST(DEFINES)
- AC_SUBST(EXTRA_LIBES)
+ AC_SUBST(EXTRA_LIBS)
])
AC_DEFUN(STEPMAKE_CXX, [
AC_PROG_CXX
STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
- CPPFLAGS="$CPPFLAGS $DEFINES"
CXXFLAGS="$CXXFLAGS $OPTIMIZE"
- LDFLAGS="$LDFLAGS $EXTRA_LIBES"
+ LD='$(CXX)'
- AC_SUBST(CXXFLAGS)
AC_SUBST(CXX)
- LD='$(CXX)'
+ AC_SUBST(CXXFLAGS)
AC_SUBST(LD)
])
rm -f $srcdir/GNUmakefile
cp $srcdir/GNUmakefile.in $srcdir/GNUmakefile
chmod 444 $srcdir/GNUmakefile
- else # --srcdir build
- rm -f GNUmakefile
- cp $srcdir/make/srcdir.make.in GNUmakefile
- chmod 444 GNUmakefile
+ else
+ if test -f $srcdir/GNUmakefile; then
+ cat <<EOF
+Source directory already configured. Please clean the source directory
+
+ make -C $srcdir distclean
+
+and rerun configure.
+EOF
+ exit 2
+ fi
+ rm -f GNUmakefile
+ cp $srcdir/GNUmakefile.in GNUmakefile
+ ## (cd $srcdir && find . -name GNUmakefile -o -name '*.make' | grep -v config.make | xargs tar -cf-) | tar -xf-
+ for i in $(cd $srcdir && find . -name GNUmakefile -o -name '*.make' | grep -v config.make); do
+ mkdir -p $(dirname $i)
+ ln -sf $srcdir/$i $i
+ done
+ ln -sf $srcdir/VERSION .
+ AC_SUBST(VPATH)
fi
])
fi
AC_SUBST(ugh_ugh_autoconf250_builddir)
+ AC_SUBST(srcdir)
AC_SUBST(stepmake)
AC_SUBST(package)
AC_SUBST(PACKAGE)
PKG_CHECK_MODULES(FREETYPE2, $1 >= $3, have_freetype2=yes, true)
if test "$have_freetype2" = yes; then
AC_DEFINE(HAVE_FREETYPE2)
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ CPPFLAGS="$FREETYPE2_CFLAGS $CPPFLAGS"
+ LIBS="$FREETYPE2_LIBS $LIBS"
AC_SUBST(FREETYPE2_CFLAGS)
AC_SUBST(FREETYPE2_LIBS)
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
else
# UGR
#r="lib$1-dev or $1-devel"
PKG_CHECK_MODULES(GTK2, $1 >= $3, have_gtk2=yes, true)
if test "$have_gtk2" = yes ; then
AC_DEFINE(HAVE_GTK2)
+ # Do not pollute user-CPPFLAGS with configure-CPPFLAGS
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ CPPFLAGS="$GTK2_CFLAGS $CPPFLAGS"
+ LIBS="$GTK2_LIBS $LIBS"
AC_SUBST(GTK2_CFLAGS)
AC_SUBST(GTK2_LIBS)
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
else
# UGR
# r="lib$1-dev or $1-devel"
PKG_CHECK_MODULES(PANGO, $1 >= $3, have_pango16=yes, true)
if test "$have_pango16" = yes ; then
AC_DEFINE(HAVE_PANGO16)
- PANGO_CFLAGS="$PANGO_CFLAGS $GTK2_CFLAGS"
- PANGO_LIBS="$PANGO_LIBS $GTK2_LIBS"
# Do not pollute user-CPPFLAGS with configure-CPPFLAGS
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
+ CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
+ LIBS="$PANGO_LIBS $LIBS"
AC_CHECK_HEADERS([pango/pangofc-fontmap.h])
AC_CHECK_FUNCS([pango_fc_font_map_add_decoder_find_func])
AC_SUBST(PANGO_CFLAGS)
if test "$have_pangoft2" = yes ; then
AC_DEFINE(HAVE_PANGO16)
AC_DEFINE(HAVE_PANGO_FT2)
- PANGO_FT2_CFLAGS="$PANGO_FT2_CFLAGS $GTK2_CFLAGS"
- PANGO_FT2_LIBS="$PANGO_FT2_LIBS $GTK2_LIBS"
# Do not pollute user-CPPFLAGS with configure-CPPFLAGS
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
PKG_CHECK_MODULES(FONTCONFIG, $1 >= $3, have_fontconfig=yes, true)
if test "$have_fontconfig" = yes ; then
AC_DEFINE(HAVE_FONTCONFIG)
- FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS"
- FONTCONFIG_LIBS="$FONTCONFIG_LIBS"
# Do not pollute user-CPPFLAGS with configure-CPPFLAGS
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
- CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS"
+ CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
LIBS="$FONTCONFIG_LIBS $LIBS"
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_LIBS)
fi
if test -z "$*"; then
- echo "warning: about to run \`./configure' without arguments."
- echo "arguments on the \`$0\'"
- echo "command line will be passed to \`./configure'."
- echo
+ cat <<EOF
+ Warning: about to run \`configure' without arguments.
+ arguments on the \`$0' command line
+ will be passed to \`configure'.
+
+ Invoke with --noconfigure to skip configure step.
+EOF
fi
echo Running $srcdir/configure $conf_flags "$@" ...
include $(stepdir)/compile-vars.make
-EXTRA_CXXFLAGS= -W -Wall -Wconversion
+EXTRA_CXXFLAGS = -W -Wall -Wconversion
#ifeq ($(MY_PATCH_LEVEL),)
#EXTRA_CXXFLAGS += -Werror
#endif
-ALL_CXXFLAGS = $(CXXFLAGS) $(ICFLAGS) $(DEFINES) $(addprefix -I,$(INCLUDES)) $(USER_CFLAGS) $(EXTRA_CFLAGS) $(MODULE_CFLAGS) $($(PACKAGE)_CFLAGS) $($(PACKAGE)_CXXFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)
+ALL_CXXPPFLAGS = $(DEFINES) $(INCLUDES:%=-I%)
+ALL_CXXFLAGS = $(CXXFLAGS) $(ALL_CXXPPFLAGS) $($(PACKAGE)_CXXFLAGS) $(CONFIG_CXXFLAGS) $(MODULE_CXXFLAGS) $(EXTRA_CXXFLAGS)
-# template files:
-TCC_FILES := $(wildcard *.tcc)
-HH_FILES := $(wildcard *.hh)
-CC_FILES := $(wildcard *.cc)
-INL_FILES := $(wildcard *.icc)
-YY_FILES := $(wildcard *.yy)
-LL_FILES := $(wildcard *.ll)
+TCC_FILES := $(call src-wildcard,*.tcc)
+HH_FILES := $(call src-wildcard,*.hh)
+CC_FILES := $(call src-wildcard,*.cc)
+INL_FILES := $(call src-wildcard,*.icc)
+YY_FILES := $(call src-wildcard,*.yy)
+LL_FILES := $(call src-wildcard,*.ll)
SOURCE_FILES+= $(CC_FILES) $(YY_FILES) $(INL_FILES) $(TCC_FILES) $(HH_FILES) $(LL_FILES)
include $(stepdir)/compile-vars.make
-H_FILES := $(wildcard *.h)
-C_FILES := $(wildcard *.c)
-Y_FILES := $(wildcard *.y)
-L_FILES := $(wildcard *.l)
+H_FILES := $(call src-wildcard,*.h)
+C_FILES := $(call src-wildcard,*.c)
+Y_FILES := $(call src-wildcard,*.y)
+L_FILES := $(call src-wildcard,*.l)
SOURCE_FILES+=$(Y_FILES) $(C_FILES) $(L_FILES) $(H_FILES)
ALL_C_SOURCES += $(H_FILES) $(C_FILES) $(Y_FILES) $(L_FILES)
-ALL_CFLAGS = $(CFLAGS) $(ICFLAGS) $(DEFINES) $(addprefix -I,$(INCLUDES)) $(USER_CFLAGS) $(EXTRA_CFLAGS) $(MODULE_CFLAGS)
+ALL_CPPFLAGS = $(CPPFLAGS) $(CONFIG_CPPFLAGS) $(DEFINES) $(INCLUDES:%=-I%)
+ALL_CFLAGS = $(CFLAGS) $(ALL_CPPFLAGS) $(CONFIG_CFLAGS) $(MODULE_CFLAGS) $(EXTRA_CFLAGS)
ARFLAGS = ru
-ALL_LDFLAGS = $(LDFLAGS) $(ILDFLAGS) $(EXTRA_LDFLAGS) $($(PACKAGE)_LDFLAGS) $(MODULE_LDFLAGS) $(USER_LDFLAGS)
+ALL_LDFLAGS = $(LDFLAGS) $(CONFIG_LDFLAGS) $($(PACKAGE)_LDFLAGS) $(MODULE_LDFLAGS) $(CONFIG_LDFLAGS)
PIC_FLAGS = -fpic -fPIC
SHARED_FLAGS = -shared
-EL_FILES := $(wildcard *.el)
+EL_FILES := $(call src-wildcard,*.el)
SOURCE_FILES += $(EL_FILES)
MODULE_LIBES =$(addprefix $(outdir)/../, $(addsuffix /$(outbase)/library.a, $(MODULE_LIBS)))
-LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(EXTRA_LIBES)
+LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(CONFIG_LIBS)
EXECUTABLE = $(outdir)/$(NAME)
EXECUTABLES = $(notdir $(EXECUTABLE))
# configure:
#
config:
- ./$(depth)/configure
+ ./$(src-depth)/configure
#
local-dist: $(DIST_FILES) $(OUT_DIST_FILES) $(NON_ESSENTIAL_DIST_FILES)
mkdir -p $(distdir)/$(localdir)
- $(LN) $(DIST_FILES) $(distdir)/$(localdir)
+ $(LN) $(DIST_FILES:%=$(src-dir)/%) $(distdir)/$(localdir)
case "$(NON_ESSENTIAL_DIST_FILES)x" in x) ;; *) \
- $(LN) $(NON_ESSENTIAL_DIST_FILES) $(distdir)/$(localdir);; \
+ $(LN) $(NON_ESSENTIAL_DIST_FILES:%=$(src-dir)/%) $(distdir)/$(localdir);; \
esac
case "$(OUT_DIST_FILES)x" in x) ;; *) \
esac
# $(foreach i, $(SUBDIRS), $(MAKE) distdir=../$(distdir) localdir=$(localdir)/$(i) -C $(i) local-dist &&) true
# absolute for installed stepmake
- $(foreach i, $(SUBDIRS), $(MAKE) topdir=$(topdir) distdir=$(distdir) localdir=$(localdir)/$(notdir $(i)) -C $(i) local-dist &&) true
+ $(foreach i, $(SUBDIRS), $(MAKE) top-src-dir=$(top-src-dir) distdir=$(distdir) localdir=$(localdir)/$(notdir $(i)) -C $(i) local-dist &&) true
cp -p $< $@
configure: configure.in aclocal.m4
- NOCONFIGURE=yes $(srcdir)/autogen.sh
+ NOCONFIGURE=yes $(src-depth)/autogen.sh
chmod +x configure
local-clean:
local-check:
# ugh. ugh ugh ugh
-$(config_make): $(topdir)/configure
+$(config_make): $(top-src-dir)/configure
@echo "************************************************************"
@echo "configure changed! You should probably reconfigure manually."
@echo "************************************************************"
- (cd $(builddir); ./config.status)
+ (cd $(top-build-dir); ./config.status)
touch $@ # do something for multiple simultaneous configs.
cd $(depth) && debuild
diff:
- $(PYTHON) $(step-bindir)/package-diff.py --outdir=$(topdir)/$(outdir) --package=$(topdir) $(makeflags)
+ $(PYTHON) $(step-bindir)/package-diff.py --outdir=$(top-src-dir)/$(outdir) --package=$(top-src-dir) $(makeflags)
-ln -f $(depth)/$(outdir)/$(distname).diff.gz $(patch-dir)
release:
- $(PYTHON) $(step-bindir)/release.py --outdir=$(topdir)/$(outdir) --package=$(topdir)
+ $(PYTHON) $(step-bindir)/release.py --outdir=$(top-src-dir)/$(outdir) --package=$(top-src-dir)
################ website.
-# directory names:
+top-build-dir = $(shell cd $(depth) && pwd)
+build-dir = $(shell cd . && pwd)
+tree-dir = $(subst $(top-build-dir),,$(build-dir))
-# depth from group-dir
-# internal, not normally used
-DEPTH = $(depth)/$(package-depth)
-
-#ifeq ($(topdir),)
-#abs-srcdir := $(shell cd $(depth); pwd)
-##deprecated
-#topdir := $(abs-srcdir)
-#endif
-
-## `which pwd` is to prevent symlink resolving intelligence
-pwd:=$(shell `which pwd`)
-current-relative-dir:=$(subst $(strip $(shell cd $(depth); `which pwd`)),,$(pwd))
+ifneq ($(configure-srcdir),.)
+srcdir-build = 1
+endif
-ifeq ($(srcdir),.)
+ifndef srcdir-build
src-depth = $(depth)
else
-src-depth = $(srcdir)
+src-depth = $(configure-srcdir)
endif
-ifeq ($(topdir),)
-abs-srcdir := $(shell cd $(src-depth); pwd)
-topdir := $(abs-srcdir)
+top-src-dir := $(shell cd $(src-depth); pwd)
+
+ifndef srcdir-build
+src-dir = .
+else
+src-dir = $(top-src-dir)$(tree-dir)
+VPATH = $(src-dir)
endif
-# derived names
+.UNEXPORT: build-dir src-dir tree-dir
+
+src-wildcard = $(subst $(src-dir)/,,$(wildcard $(src-dir)/$(1)))
+
ifeq ($(distdir),)
- distdir = $(topdir)/$(outdir)/$(DIST_NAME)
+ distdir = $(top-src-dir)/$(outdir)/$(DIST_NAME)
DIST_NAME = $(package)-$(TOPLEVEL_VERSION)
endif
distname = $(package)-$(TOPLEVEL_VERSION)
doc-dir = $(src-depth)/Documentation
po-dir = $(src-depth)/po
-
-# sort-out which of these are still needed
-#
-$(package)_bindir = $(depth)/bin
step-bindir = $(stepmake)/bin
+# stepmake package support.
+DEPTH = $(depth)/$(package-depth)
+
group-dir = $(shell cd $(DEPTH);pwd)/..
release-dir = $(group-dir)/releases
patch-dir = $(group-dir)/patches
-#
-# i have in $HOME/.rpmrc
-# topdir: /home/fred/usr/src/Redhat
-#
rpm-sources = $(release-dir)
rpm-build = $(group-dir)/RedHat/BUILD
-#
-
-# package-icon=$(outdir)/$(package)-icon.gif
-package-icon=$(outdir)/$(package)-icon.xpm
+package-icon = $(outdir)/$(package)-icon.xpm
-
-# need to be defined in local Makefiles:
-#
-FOOBAR =
-# the version:
-#
-ifneq ($(MY_PATCH_LEVEL),$(FOOBAR))
+ifneq ($(strip $(MY_PATCH_LEVEL)),)
VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL).$(MY_PATCH_LEVEL)
else
VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
endif
-ifneq ($(TOPLEVEL_MY_PATCH_LEVEL),$(FOOBAR))
+ifneq ($(strip $(TOPLEVEL_MY_PATCH_LEVEL)),)
TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL).$(TOPLEVEL_MY_PATCH_LEVEL)
else
TOPLEVEL_VERSION=$(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)
SILENT_LOG = 2>&1 > /dev/null
date := $(shell date +%x) #duplicated?
-INCLUDES = include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES)
+INCLUDES = $(src-dir)/include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES)
M4 = m4
-#replace to do stripping of certain objects
-STRIPDEBUG=true
-
-DIST_FILES=$(EXTRA_DIST_FILES) GNUmakefile $(ALL_SOURCES) $(wildcard SConscript)
+DIST_FILES=$(EXTRA_DIST_FILES) GNUmakefile $(ALL_SOURCES) $(src-wildcard,SConscript)
DOCDIR=$(depth)/$(outdir)
+#?
+STRIPDEBUG=true
STRIP=strip --strip-debug
-
-# substitute $(STRIP) in Site.make if you want stripping
DO_STRIP=true
+
LOOP=$(foreach i, $(SUBDIRS), $(MAKE) PACKAGE=$(PACKAGE) package=$(package) -C $(i) $@ &&) true
ETAGS_FLAGS =
makeflags=$(patsubst %==, %, $(patsubst ---%,,$(patsubst ----%,,$(MAKEFLAGS:%=--%))))
-IN_FILES := $(wildcard *.in)
+IN_FILES := $(call src-wildcard,*.in)
SOURCE_FILES += $(IN_FILES)
# Preprocessed .in documentation _FILES:
ifeq ($(HOST_ARCH),i686-pc-cygwin)
CYGWIN_BUILD = yes
endif
-#
-# ugh-- what if someone decides on: 'i568-pc-cygwin-gnu'
ifeq ($(HOST_ARCH),i686-cygwin)
CYGWIN_BUILD = yes
endif
# cases. Four more explaining what a line comment is, and that it may
# be parsed, same here.
-HELP2MAN_COMMAND = $(PERL) $(builddir)/buildscripts/$(outbase)/help2man $< > $@
+HELP2MAN_COMMAND = $(PERL) $(top-build-dir)/buildscripts/$(outbase)/help2man $< > $@
ifeq ($(strip $(CROSS)),no)
$(outdir)/%.1: $(outdir)/%
-MAKE_FILES := $(wildcard *.make)
-LSM_FILES:= $(wildcard *.lsm.in)
+MAKE_FILES := $(call src-wildcard,*.make)
+LSM_FILES:= $(call src-wildcard,*.lsm.in)
+SPEC_FILES:= $(call src-wildcard,*.spec.in)
+
OUTLSM_FILES=$(addprefix $(outdir)/,$(basename $(LSM_FILES)))
-SPEC_FILES:= $(wildcard *.spec.in)
OUTSPEC_FILES=$(addprefix $(outdir)/,$(basename $(SPEC_FILES)))
OUT_DIST_FILES= $(strip $(OUTLSM_FILES) $(OUTSPEC_FILES))
# we want to see botched results as well.
$(outdir)/%.dvi: %.mf
- -$(METAFONT) "\scrollmode; input $<;"
- gftodvi $(basename $<)
+ -MFINPUTS=$(src-dir) $(METAFONT) "\scrollmode; input $<;"
+ gftodvi $(basename $<)
mv $(basename $<).dvi $(outdir)
rm $(basename $<).*gf
# This is not metafont, this is feta-specific
$(outdir)/%.log: %.mf
- $(METAFONT) "\mode:=$(MFMODE); nonstopmode; input $<;"
+ MFINPUTS=$(src-dir) $(METAFONT) "\mode:=$(MFMODE); nonstopmode; input $<;"
mv $(@F) $@
rm $(basename $(@F)).*gf
$(outdir)/%.tfm $(outdir)%.log: %.mf
- $(METAFONT) "\mode:=$(MFMODE); nonstopmode; input $<;"
+ MFINPUTS=$(src-dir) $(METAFONT) "\mode:=$(MFMODE); nonstopmode; input $<;"
# Let's keep this log output, it saves another mf run.
mv $(basename $(@F)).log $(basename $(@F)).tfm $(outdir)
rm $(basename $(@F)).*gf
$(outdir)/%.$(XPM_RESOLUTION)gf: %.mf
- $(METAFONT) "\\mode=$(XPM_MODE); \\input $<"
+ MFINPUTS=$(src-dir) $(METAFONT) "\\mode=$(XPM_MODE); \\input $<"
# Let's keep this log output, it saves another mf run.
mv $(@F) $(basename $(@F)).log $(basename $(@F)).tfm $(outdir)
MFTRACE_FORMATS = pfa pfb svg
$(outdir)/%.pfb $(outdir)/%.svg $(outdir)/%.pfa: %.mf
- $(MFTRACE) $(MFTRACE_FLAGS) -I $(outdir)/ --formats=pfa,pfb,svg $(basename $(@F))
+ MFINPUTS=$(src-dir) $(MFTRACE) $(MFTRACE_FLAGS) -I $(src-dir) -I $(outdir)/ --formats=pfa,pfb,svg $(basename $(@F))
# -mv $(MFTRACE_FORMATS:%=$(basename $(@F).%)) $(outdir)
-mv $(basename $(@F)).pfa $(outdir)
-mv $(basename $(@F)).pfb $(outdir)
-MF_FILES := $(wildcard *.mf)
+MF_FILES := $(call src-wildcard,*.mf)
EXTRA_DIST_FILES += $(MF_FILES)
MF_TFM_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.tfm))
MF_DVI_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.dvi))
-# MF_FILES := $(wildcard *.mf)
-# FONT_FILES = $(wildcard *[0-9].mf)
-# EXTRA_DIST_FILES += $(MF_FILES)
MP_PFA_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.pfa))
PFA_FILES += $(MP_PFA_FILES)
+POD_FILES := $(call src-wildcard,*.pod)
-POD_FILES := $(wildcard *.pod)
OUTPOD_FILES = $(addprefix $(outdir)/,$(POD_FILES))
-PY_MODULES_IN = $(wildcard *.py)
+PY_MODULES_IN = $(call src-wildcard,*.py)
OUT_PY_MODULES = $(PY_MODULES_IN:%=$(outdir)/%)
OUT_PYC_MODULES = $(OUT_PY_MODULES:%.py=%.pyc)
ifneq ($(CYGWIN_BUILD),)
-SCM_FILES := $(wildcard *.scm)
+SCM_FILES := $(call src-wildcard,*.scm)
SOURCE_FILES += $(SCM_FILES)
-PERL_SCRIPTS_IN := $(wildcard *.pl)
+PERL_SCRIPTS_IN := $(call src-wildcard,*.pl)
+BASH_SCRIPTS_IN := $(call src-wildcard,*.bash)
+EXPECT_SCRIPTS_IN := $(call src-wildcard,*.expect)
+SCM_SCRIPTS_IN := $(call src-wildcard,*.scm)
+SH_SCRIPTS_IN := $(call src-wildcard,*.sh)
+
PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.pl=))
-BASH_SCRIPTS_IN := $(wildcard *.bash)
BASH_SCRIPTS = $(addprefix $(outdir)/, $(BASH_SCRIPTS_IN:.bash=))
-EXPECT_SCRIPTS_IN := $(wildcard *.expect)
EXPECT_SCRIPTS = $(addprefix $(outdir)/, $(EXPECT_SCRIPTS_IN:.expect=))
-SCM_SCRIPTS_IN := $(wildcard *.scm)
SCM_SCRIPTS = $(addprefix $(outdir)/, $(SCM_SCRIPTS_IN:.scm=))
-SH_SCRIPTS_IN := $(wildcard *.sh)
SH_SCRIPTS = $(addprefix $(outdir)/, $(SH_SCRIPTS_IN:.sh=))
-PYTHON_SCRIPTS_IN := $(wildcard *.py)
PYTHON_SCRIPTS = $(addprefix $(outdir)/, $(PYTHON_SCRIPTS_IN:.py=))
ALL_SCRIPTS_IN = $(BASH_SCRIPTS_IN) $(EXPECT_SCRIPTS_IN) $(PERL_SCRIPTS_IN) $(PYTHON_SCRIPTS_IN) $(SCM_SCRIPTS_IN) $(SH_SCRIPTS_IN)
EXTRA_DIST_FILES += $(ALL_SCRIPTS_IN)
DO_LO_DEP = rm -f $(lo-dep-out); DEPENDENCIES_OUTPUT="$(lo-dep-out) $(outdir)/$(notdir $@)"
LO_FILES += $(addprefix $(outdir)/, $(Y_FILES:.y=.lo) $(C_FILES:.c=.lo) $(L_FILES:.l=.lo))
-
$(MAKEINFO) -I $(outdir) --output=$@ $<
$(outdir)/%.html: $(outdir)/%.texi
- $(MAKEINFO) -I $(outdir) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html --no-split --no-headers $<
+ $(MAKEINFO) -I $(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
$(outdir)/%.html.omf: %.texi
$(call GENERATE_OMF,html)
# Generic rule not possible?
$(outdir)/%/%.html: $(outdir)/%.texi
- $(MAKEINFO) --output=$@ --css-include=$(abs-srcdir)/Documentation/texinfo.css --html $<
+ $(MAKEINFO) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
$(outdir)/%.dvi: $(outdir)/%.texi
cd $(outdir); texi2dvi --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
$(outdir)/%.txt: $(outdir)/%.texi
- $(MAKEINFO) -I $(pwd) -I $(outdir) --no-split --no-headers --output $@ $<
+ $(MAKEINFO) -I $(src-dir) -I $(outdir) --no-split --no-headers --output $@ $<
$(outdir)/%.texi: %.texi
rm -f $@
-TEXI_FILES = $(wildcard *.texi)
+TEXI_FILES = $(call src-wildcard,*.texi)
ALL_SOURCES += $(TEXI_FILES)
OUTTXT_FILES += $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.txt))
-GENERATE_OMF = $(PYTHON) $(depth)/buildscripts/texi2omf.py --format $(1) --location $(webdir)/$(current-relative-dir)/out-www/$(notdir $(basename $@)) --version $(TOPLEVEL_VERSION) $< > $@
+GENERATE_OMF = $(PYTHON) $(depth)/buildscripts/texi2omf.py --format $(1) --location $(webdir)/$(tree-dir)/out-www/$(notdir $(basename $@)) --version $(TOPLEVEL_VERSION) $< > $@
TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper)
copy-to-top: $(TO_TOP_FILES)
$(foreach i, $(TO_TOP_FILES), \
- cp $(i) $(builddir) && ) true
+ cp $(i) $(top-build-dir) && ) true
local-WWW: $(HTML_FILES) $(PDF_FILES) copy-to-top
rm -f config.hh config.make Makefile GNUmakefile \
config.cache config.status config.log index.html \
stepmake/stepmake/stepmake stepmake/stepmake/bin
+ rm -rf autom4te.cache
local-maintainerclean:
rm -f configure
. release==\n\
. to=0.1.74.jcn2\n\
dist roll tarball: $(depth)/$(outdir)/$(distname).tar.gz\n\
- distclean cleaner than clean (duh)\n\
+ distclean also remove configure output\n\
doc update all documentation\n\
- release roll tarball and generate patch\n\
+ maintainerclean also remove distributed generated files\n\
po make new translation Portable Object database\n\
po-replace do po-update and replace catalogs with msgmerged versions\n\
po-update update translation Portable Object database\n\
+ release roll tarball and generate patch\n\
\n\
Some of these top level targets (diff, dist, release) can be issued\n\
from anywhere in the source tree.\n\
LILYPOND_WORDS = $(outdir)/lilypond-words $(outdir)/lilypond-words.vim
LILYPOND_WORDS_DEPENDS =\
- $(topdir)/lily/lily-lexer.cc \
+ $(top-src-dir)/lily/lily-lexer.cc \
$(buildscript-dir)/lilypond-words.py \
- $(topdir)/scm/markup.scm \
- $(topdir)/ly/engraver-init.ly
+ $(top-src-dir)/scm/markup.scm \
+ $(top-src-dir)/ly/engraver-init.ly
STEPMAKE_TEMPLATES=install-out
-rmdir -p $(DESTDIR)$(vimdir)/syntax
$(LILYPOND_WORDS):
- cd $(topdir) && $(PYTHON) buildscripts/lilypond-words.py --words --vim --dir=$(builddir)/vim/$(outconfbase)
+ cd $(top-src-dir) && $(PYTHON) buildscripts/lilypond-words.py --words --vim --dir=$(top-build-dir)/vim/$(outconfbase)
all: $(LILYPOND_WORDS)