From: Jan Nieuwenhuizen Date: Fri, 23 Feb 2001 18:42:06 +0000 (+0100) Subject: patch::: 1.3.130.jcn4 X-Git-Tag: release/1.3.131~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0713e9256dc1f35299ce716cf29ddeab4ebca93b;p=lilypond.git patch::: 1.3.130.jcn4 1.3.130.jcn4 ============ * Makefile template using dependencies: make/ly.make. Needs some simple examples. * Depencies fixes for lilypond, ly2dvi and lilypond-book. --- diff --git a/CHANGES b/CHANGES index 6ad09c4548..0733f2e738 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +1.3.130.jcn4 +============ + +* Makefile template using dependencies: make/ly.make. Needs some +simple examples. + +* Depencies fixes for lilypond, ly2dvi and lilypond-book. + 1.3.130.jcn3 ============ diff --git a/VERSION b/VERSION index c425c63dc6..8032bf8d0d 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=130 -MY_PATCH_LEVEL=jcn3 +MY_PATCH_LEVEL=jcn4 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/regression/beam-extreme.ly b/input/regression/beam-extreme.ly index 653024e70c..8fa8d4a2d4 100644 --- a/input/regression/beam-extreme.ly +++ b/input/regression/beam-extreme.ly @@ -15,5 +15,11 @@ Stems may be short, but noteheads should never touch the beam. } \paper{ linewidth=-1.; + \translator { + \VoiceContext + % If we want to test extreme beams, + % we should not have them auto-kneed + Beam \override #'auto-knee-gap = ##f + } } } diff --git a/lily/include/main.hh b/lily/include/main.hh index af12beda0b..bc8de748d0 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -23,6 +23,7 @@ extern void set_inclusion_names (Array); /* options */ extern bool dependency_global_b; +extern String dependency_prefix_global; extern Array dump_header_fieldnames_global; extern bool no_paper_global_b; extern bool no_timestamps_global_b; diff --git a/lily/main.cc b/lily/main.cc index d5ed455e4b..d9b1c6f315 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -41,6 +41,9 @@ /* Write dependencies file? */ bool dependency_global_b = false; +/* Prepend to dependencies */ +String dependency_prefix_global; + /* Names of header fields to be dumped to a separate file. */ Array dump_header_fieldnames_global; @@ -105,6 +108,7 @@ static Long_option_init options_static[] = { {_i ("DIR"), "include", 'I', _i ("add DIR to search path")}, {_i ("FILE"), "init", 'i', _i ("use FILE as init file")}, {0, "dependencies", 'M', _i ("write Makefile dependencies for every input file")}, + {_i ("DIR"), "dep-prefix", 'P', _i ("prepend DIR to dependencies")}, {0, "no-paper", 'm', _i ("produce MIDI output only")}, {_i ("NAME"), "output", 'o', _i ("write output to NAME")}, {0, "safe", 's', _i ("inhibit file output naming and exporting")}, @@ -112,7 +116,7 @@ static Long_option_init options_static[] = { {0, "version", 'v', _i ("print version number")}, {0, "verbose", 'V', _i("verbose")}, {0, "warranty", 'w', _i ("show warranty and copyright")}, - {0,0,0, 0} + {0,0,0,0} }; void @@ -304,7 +308,7 @@ String format_to_ext (String format) { if (format == "tex") - /* .lytex change in separate (revertable) patch: 1.3.130.jcn4 */ + /* .lytex change put off */ return "tex"; // "lytex"; return format; } @@ -421,6 +425,9 @@ main (int argc, char **argv) case 'f': output_format_global = oparser_p_static->optional_argument_ch_C_; break; + case 'P': + dependency_prefix_global = oparser_p_static->optional_argument_ch_C_; + break; case 'H': dump_header_fieldnames_global.push (oparser_p_static->optional_argument_ch_C_); break; diff --git a/lily/scores.cc b/lily/scores.cc index 0e8659a1d8..8d3cf3b30c 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -5,6 +5,15 @@ (c) 1997--2000 Han-Wen Nienhuys */ +#include "config.h" + +#include +#include +#if HAVE_SYS_STAT_H +#include +#endif +#include + #include #include "main.hh" #include "score.hh" @@ -41,8 +50,11 @@ void write_dependency_file (String fn, Array targets, f << "# Generated automatically by: " << gnu_lilypond_version_str () << '\n'; String out; for (int i=0; i < targets.size (); i ++) - out += targets[i] + " "; + out += dependency_prefix_global + targets[i] + " "; out += ": "; +#if 0 + struct stat stat_buf; +#endif for (int i=0; i < deps.size (); i ++) { if (out.length_i() > WRAPWIDTH) @@ -50,7 +62,18 @@ void write_dependency_file (String fn, Array targets, f << out << "\\\n"; out = " "; } - out += " " + deps[i]; + String dep = deps[i]; + if (!dependency_prefix_global.empty_b ()) + { +#if 0//thinko? + if (stat (dep.ch_C (), &stat_buf) == -1 && errno == ENOENT) + ; //make emacs happy +#else + if (dep.index_i ('/') < 0) +#endif + dep = dependency_prefix_global + dep; + } + out += " " + dep; } f << out << endl; } diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 83a0972f8b..6103ad5a8f 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -1,20 +1,38 @@ export PATH:=$(topdir)/lily/out:$(topdir)/buildscripts/out:$(PATH) -# Huh, PATHSEP, but still '/' for dirsep? -# Doesn't make sense. -ifeq (0,1) +export MFINPUTS:=$(topdir)/mf/:$(MFINPUTS):: +export TEXINPUTS:=$(topdir)/mf/out/:$(topdir)/tex/:$(topdir)/ps/:$(TEXINPUTS):$(pwd):: +export LILYINCLUDE:=$(topdir)/ps:$(topdir)/scm:$(topdir)/ly:$(topdir)/mf/out::$(TEX_TFMDIR):$(LILYINCLUDE) + +export LILYPONDPREFIX:=$(depth)/ + + +the-script-dir=$(wildcard $(script-dir)) -export MFINPUTS:=$(topdir)/mf/$(PATHSEP)$(MFINPUTS)$(PATHSEP)$(PATHSEP) -export TEXINPUTS:=$(topdir)/mf/out/$(PATHSEP)$(topdir)/tex/$(PATHSEP)$(topdir)/ps/$(PATHSEP)$(TEXINPUTS)$(PATHSEP)$(pwd)$(PATHSEP)$(PATHSEP) -export LILYINCLUDE:=$(topdir)/ps$(PATHSEP)$(topdir)/scm$(PATHSEP)$(topdir)/ly$(PATHSEP)$(topdir)/mf/out$(PATHSEP)$(PATHSEP)$(TEX_TFMDIR)$(PATHSEP)$(LILYINCLUDE) +ifneq ($(the-script-dir),) + +$(message running from source tree stepmake) + +ABC2LY = $(script-dir)/abc2ly.py +CONVERT_LY = $(script-dir)/convert-ly.py +LY2DVI = $(script-dir)/ly2dvi.py +LILYPOND_BOOK = $(script-dir)/lilypond-book.py +LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ +PS_TO_GIFS = $(buildscript-dir)/ps-to-gifs.sh +PS_TO_PNGS = $(buildscript-dir)/ps-to-pgns.sh else -export MFINPUTS:=$(topdir)/mf/:$(MFINPUTS):: -export TEXINPUTS:=$(topdir)/mf/out/:$(topdir)/tex/:$(topdir)/ps/:$(TEXINPUTS):$(pwd):: -export LILYINCLUDE:=$(topdir)/ps:$(topdir)/scm:$(topdir)/ly:$(topdir)/mf/out::$(TEX_TFMDIR):$(LILYINCLUDE) +$(message running from installed stepmake) + +ABC2LY = $(shell $(SHELL) -c 'type -p abc2ly') +LY2DVI = $(shell $(SHELL) -c 'type -p ly2dvi') +CONVERT_LY = $(shell $(SHELL) -c 'type -p convert-ly') +LILYPOND_BOOK = $(shell $(SHELL) -c 'type -p lilypond-book') +LILYPOND_BOOK_INCLUDES = -I. -I.. -I$(outdir) +PS_TO_GIFS = $(shell $(SHELL) -c 'type -p ps-to-gifs') +PS_TO_PNGS = $(shell $(SHELL) -c 'type -p ps-to-pgns') endif -export LILYPONDPREFIX:=$(depth)/ diff --git a/make/ly-rules.make b/make/ly-rules.make index ea199bca79..92839d41a0 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -5,21 +5,24 @@ $(outdir)/%.latex: %.doc rm -f $@ - LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) -I $(pwd) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ --dependencies $< +# LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) $< chmod -w $@ # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir. # it is not, for --srcdir builds $(outdir)/%.texi: %.tely rm -f $@ - LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) -I $(pwd) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ --dependencies --format=texi $< +# LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi $< chmod -w $@ # nexi: no-lily texi # for plain info doco: don't run lily $(outdir)/%.nexi: %.tely rm -f $@ - LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) --no-lily -I $(pwd) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ --dependencies --format=texi $< +# LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi --no-lily $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi --no-lily $< mv $(@D)/$(*F).texi $@ chmod -w $@ diff --git a/make/ly.make b/make/ly.make index 0a0d8a6f2a..6980251248 100644 --- a/make/ly.make +++ b/make/ly.make @@ -1,111 +1,35 @@ #!/usr/bin/make -# Mutopia Makefile Project -# - -# -# For testing installed lily -# -make-root=$(wildcard $(HOME)/tmp/test/usr/share/lilypond/make) -#make-root=$(wildcard $(HOME)/usr/src/lilypond/make) -make-root?=$(wildcard /usr/share/lilypond/make) - -ifneq ($(make-root),) - -depth=$(make-root)/.. -LOCALSTEPMAKE_TEMPLATES=mutopia -include $(make-root)/stepmake.make - -else - burp # -# Minimalistic standalone part. I'd very much like to install make/* -# and stepmake/stepmake/* in /usr/share/lilypond, and junk this. -# - -outdir=out -PAPERSIZE= -LY_FILES=$(wildcard *.ly) - -default: - echo $(DEP_FILES) - $(examples) -clean: - rm -f $(outdir)/* $(outdir)-letter/* - - -# -# stepmake/stepmake/files.ly -# -DEP_FILES:=$(wildcard $(outdir)/*.dep) - -# -# stepmake/stepmake/generic-targets.make -# -include $(outdir)/dummy.dep $(DEP_FILES) - -$(outdir)/dummy.dep: - -mkdir -p $(outdir) - touch $(outdir)/dummy.dep - +# Mutopia Makefile Project # -# make/mutopia-rules.make +# Rename this file to GNUmakefile, and issue `make help' # -# don't junk intermediate .dvi files. They're easier to view than -# .ps or .png -.PRECIOUS: $(outdir)/%.dvi # -# should we dist ps-to-pngs? +# Magic: find and include LilyPond's StepMake rules # -$(outdir)/%.png: $(outdir)/%.ps - ps-to-pngs $< - -mv $(name-stem)-page*.png $(outdir)/ - touch $@ - -$(outdir)/%.dvi: %.ly - ly2dvi --outdir=$(outdir) --dependencies $< - -mv $(basename $<)*.midi $(outdir) - -$(outdir)-$(PAPERSIZE)/%.dvi: %.ly - ly2dvi.py --outdir=$(outdir)-$(PAPERSIZE) --dependencies --papersize=$(PAPERSIZE) $< - -mv $(basename $<)*.midi $(outdir)-$(PAPERSIZE) - - +# First, try source tree +# Second, try installed tree in $HOME +# Third, try system installed tree # -# stepmake/stepmake/tex-rules.make # -$(outdir)/%.tex: %.tex - cp $< $@ - -$(outdir)/%.dvi: $(outdir)/%.tex - (cd $(outdir); tex \\nonstopmode \\input $( %s""" cmd = cmd % (g + '.eps', g + '.png') system (cmd) - if g_outdir: - os.chdir(d) + os.chdir (d) def update_file (body, name): @@ -1050,7 +1050,7 @@ Han-Wen Nienhuys def write_deps (fn, target, chunks): global read_files - sys.stdout.write('writing `%s\'\n' % os.path.join(g_outdir, fn)) + sys.stdout.write('Writing `%s\'\n' % os.path.join(g_outdir, fn)) f = open (os.path.join(g_outdir, fn), 'w') f.write ('%s%s: ' % (g_dep_prefix, target)) for d in read_files: @@ -1063,6 +1063,10 @@ def write_deps (fn, target, chunks): for d in basenames: if g_outdir: d=g_outdir + '/' + d + if g_dep_prefix: + #if not os.isfile (d): # thinko? + if not re.search ('/', d): + d = g_dep_prefix + d f.write ('%s.tex ' % d) f.write ('\n') #if len (basenames): @@ -1107,6 +1111,7 @@ def fix_epswidth (chunks): return newchunks +foutn="" def do_file(input_filename): global foutn file_settings = {} @@ -1129,6 +1134,8 @@ def do_file(input_filename): scan_preamble(chunks) chunks = process_lilypond_blocks(my_outname, chunks) + foutn = os.path.join (g_outdir, my_outname + '.' + format) + # Do It. if __main__.g_run_lilypond: compile_all_files (chunks) @@ -1139,7 +1146,6 @@ def do_file(input_filename): x = 0 chunks = completize_preamble (chunks) - foutn = os.path.join(g_outdir, my_outname + '.' + format) sys.stderr.write ("Writing `%s'\n" % foutn) fout = open (foutn, 'w') for c in chunks: diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index 3075a506fb..5d97714123 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -923,14 +923,10 @@ def getLilyopts(): inc = '' if len(Props.get('include')) > 0: inc = string.join (map (lambda x: '-I "%s"' % x, Props.get('include'))) - else: - - if Props.get('dependencies'): - dep=' --dependencies' - else: - dep='' - return inc + dep - return inc + dep='' + if Props.get('dependencies'): + dep=' --dependencies' + return inc + dep def writeLilylog(file,contents): if Props.get('keeplilypond'): @@ -1159,8 +1155,8 @@ def main(): outdir=Props.get ('output') for i in depFiles: text=open (i).read () - # brr - # text=re.sub ('\n([^:]*:)', '\n' + outdir + '/\\1', text) + # ugh, should use lilypond -o DIR/foo.tex + # or --dep-prefix to fix dependencies text=re.sub ('\n([^:]*).tex', '\n' + outdir + '/\\1.dvi', text) text=re.sub (' ([^:]*).tex', ' ' + outdir + '/\\1.dvi', text) open (os.path.join (outdir, i), 'w').write (text) diff --git a/stepmake/stepmake/generic-targets.make b/stepmake/stepmake/generic-targets.make index f9ee8b35df..cf43961a60 100644 --- a/stepmake/stepmake/generic-targets.make +++ b/stepmake/stepmake/generic-targets.make @@ -1,7 +1,7 @@ # title generic make targets # file make/Targets.make -.PHONY : all clean config default dist doc exe help html lib TAGS\ +.PHONY : all clean config default diff dist doc exe help html lib TAGS\ po all: default @@ -42,14 +42,14 @@ config: generic-help: @echo -e "\ Makefile for $(PACKAGE_NAME) $(TOPLEVEL_VERSION)\n\ -Usage: $(MAKE) ["VARIABLE=value"]... [TARGET]\n\ +Usage: make ["VARIABLE=value"]... [TARGET]\n\ \n\ Targets:\n" help: generic-help local-help @echo -e "\ all update everything\n\ - clean remove all genated stuff in $(oudir)\n\ + clean remove all genated stuff in $(outdir)\n\ config rerun configure\n\ deb build Debian package\n\ default same as the empty target\n\