]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.130.jcn4
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 23 Feb 2001 18:42:06 +0000 (19:42 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 23 Feb 2001 18:42:06 +0000 (19:42 +0100)
1.3.130.jcn4
============

* Makefile template using dependencies: make/ly.make.  Needs some
simple examples.

* Depencies fixes for lilypond, ly2dvi and lilypond-book.

16 files changed:
CHANGES
VERSION
input/regression/beam-extreme.ly
lily/include/main.hh
lily/main.cc
lily/scores.cc
make/lilypond-vars.make
make/ly-rules.make
make/ly.make
make/mutopia-rules.make
make/mutopia-targets.make
make/mutopia-vars.make
mutopia/Coriolan/GNUmakefile
scripts/lilypond-book.py
scripts/ly2dvi.py
stepmake/stepmake/generic-targets.make

diff --git a/CHANGES b/CHANGES
index 6ad09c4548dfae4516a4619c6793c94d8571a0f7..0733f2e73863df398111383207217eadfb5014bb 100644 (file)
--- 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 c425c63dc65c846147eb33c021cd0d101149a1ab..8032bf8d0dc10ec7a86828194a29556ee4d926a4 100644 (file)
--- 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.
index 653024e70c3619d084478b6bb05fd191f3f8b61a..8fa8d4a2d4bb1253ebcef58ed32162d0737852c5 100644 (file)
@@ -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
+               }
        }
 }
index af12beda0bf3df4edcbb57a2e70743c59bd5dad9..bc8de748d0c1d69400757e8c81e2f4a6ca0bbc26 100644 (file)
@@ -23,6 +23,7 @@ extern void set_inclusion_names (Array<String>);
 
 /* options */
 extern bool dependency_global_b;
+extern String dependency_prefix_global;
 extern Array<String> dump_header_fieldnames_global;
 extern bool no_paper_global_b;
 extern bool no_timestamps_global_b;
index d5ed455e4befe7fa0d871db92db63095dd585272..d9b1c6f315bd3895ef436ecd9084593af8cd72a5 100644 (file)
@@ -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<String> 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;
index 0e8659a1d811c88089d27938405f29cb5d762ee1..8d3cf3b30c08ae636a377c601eda79f88562393f 100644 (file)
@@ -5,6 +5,15 @@
 
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+#include "config.h"
+
+#include <errno.h>
+#include <sys/types.h>
+#if HAVE_SYS_STAT_H 
+#include <sys/stat.h>
+#endif
+#include <unistd.h>
+
 #include <fstream.h>
 #include "main.hh"
 #include "score.hh"
@@ -41,8 +50,11 @@ void write_dependency_file (String fn, Array<String> 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<String> 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; 
 }
index 83a0972f8b6b23359339bf21dce2d24ed3c25ff9..6103ad5a8f28cab2d3c92979c6b07a781728e76e 100644 (file)
@@ -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)/
index ea199bca79fa52557da1106e2cdbaa2508f123d6..92839d41a02cc9acb946fa2bd48028bacb2cdf05 100644 (file)
@@ -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 $@
 
index 0a0d8a6f2ab3ca0aa6ca129729f4421ee912e565..69802512487946cd6966a39d3708ce41b588d171 100644 (file)
 #!/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 $(<F))
-
-$(outdir)/%.dvi: $(outdir)/%.latex
-       (cd $(outdir)&& \
-         latex \\nonstopmode \\input $(<F)&&\
-         (bibtex $(basename $(<F)) || true) && \
-         latex \\nonstopmode \\input $(<F)&&\
-         (makeindex $(basename $(<F)) || true) && \
-         latex \\nonstopmode \\input $(<F) )
-
-$(outdir)/%.ps: $(outdir)/%.dvi
-       cd $(outdir) && dvips -ta4 -o $(@F) $(<F)
-
-$(outdir)-$(PAPERSIZE)/%.ps: $(outdir)-$(PAPERSIZE)/%.dvi
-       cd $(outdir) && dvips -t$(PAPERSIZE) -o $(@F) $(<F)
-
-
+##For testing installed lily
+##make-root=$(wildcard $(HOME)/tmp/test/usr/share/lilypond/make)
 #
-# make/ly-rules.make
 #
-
-$(outdir)/%.latex: %.doc
-       rm -f $@
-       lilypond-book --outdir=$(outdir) --dependencies $<
-       chmod -w $@
-
+make-root=$(wildcard $(HOME)/usr/src/lilypond/make)
+make-root?=$(wildcard /usr/share/lilypond/make)
+make-root?=$(wildcard /usr/share/lilypond/make)
+ifneq ($(make-root),)
+$(message running from $(make-root))
+depth=$(make-root)/..
+LOCALSTEPMAKE_TEMPLATES=ly mutopia
+include $(make-root)/stepmake.make
+else
+$(error can't find LilyPond's stepmake installation)
 endif
+#
 
 
 #
@@ -113,14 +37,7 @@ endif
 # This needs some work.
 #
 
-
 parts=$(patsubst %.ly,%,$(wildcard *-part.ly))
-
-tarball=coriolan
-mutopia-examples=coriolan $(parts)
-mutopia-letter=$(mutopia-examples:%=out-letter/%.ps.gz)
-
-
-mutopia:
-       $(MAKE) examples="$(mutopia-examples)" PAPERSIZE=letter local-WWW $(mutopia-letter)
+tarball=$(name)
+mutopia-examples=$(name)
 
index 39a12f41046bc6c58bdfc53121077f73834bbfed..382871d39f94e58cb6f27f32ee666a1f06626001 100644 (file)
@@ -1,12 +1,12 @@
 
 
 $(outdir)/%.gif: $(outdir)/%.ps
-       sh $(buildscript-dir)/ps-to-gifs.sh $<
+       sh $(PS_TO_GIFS) $<
        -mv $(name-stem)-page*.gif $(outdir)/
        touch $@
 
 $(outdir)/%.png: $(outdir)/%.ps
-       sh $(buildscript-dir)/ps-to-pngs.sh $<
+       sh $(PS_TO_PNGS) $<
        -mv $(name-stem)-page*.png $(outdir)/
        touch $@
 
@@ -18,10 +18,10 @@ $(outdir)/%.ly.txt: %.abc
        ln -f $< $@
 
 $(outdir)/%.ly: %.abc
-       $(PYTHON) $(script-dir)/abc2ly.py -o $@ $< 
+       $(PYTHON) $(ABC2LY) -o $@ $< 
 
 $(outdir)/%.dvi: $(outdir)/%.ly
-       $(PYTHON) $(script-dir)/ly2dvi.py --outdir=$(outdir) --dependencies $< 
+       $(PYTHON) $(LY2DVI) --outdir=$(outdir) --dependencies $< 
        -mv $(basename $(<F))*.midi $(outdir)
 
 # don't junk intermediate .dvi files.  They're easier to view than
@@ -29,13 +29,13 @@ $(outdir)/%.dvi: $(outdir)/%.ly
 .PRECIOUS: $(outdir)/%.dvi
 
 $(outdir)/%.dvi: %.ly
-       $(PYTHON) $(script-dir)/ly2dvi.py --outdir=$(outdir) --dependencies $< 
+       $(PYTHON) $(LY2DVI) --outdir=$(outdir) --dependencies $< 
        -mv $(basename $<)*.midi $(outdir)
 
 $(outdir)-$(PAPERSIZE)/%.dvi: %.ly
-       $(PYTHON) $(script-dir)/ly2dvi.py --outdir=$(outdir)-$(PAPERSIZE) --dependencies --papersize=$(PAPERSIZE) $< 
+       $(PYTHON) $(LY2DVI) --outdir=$(outdir)-$(PAPERSIZE) --dependencies --papersize=$(PAPERSIZE) $< 
        -mv $(basename $<)*.midi $(outdir)-$(PAPERSIZE)
 
 $(outdir)/%.dvi: %.fly
-       $(PYTHON) $(script-dir)/ly2dvi.py -o $(outdir)  $< 
+       $(PYTHON) $(LY2DVI) -o $(outdir)  $< 
        -mv $(basename $<)*.midi $(outdir)
index 806ff65c6b5430c980d1b911bf04b554701e98f4..5c7011da3d8e43d3db48975237825d2d646288e2 100644 (file)
@@ -1,10 +1,9 @@
 
+.PHONY: mutopia png ps scores tar
 
 all: $(OUT_FILES)
 
 local-WWW: $(ly_examples) $(fly_examples) $(ps_examples) $(png_examples)
-#      (cd $(outdir); $(PYTHON) ../$(buildscript-dir)/mutopia-index.py --prefix=../ --suffix=/$(outdir) $(html_subdirs) $(all_examples))
-#      $(footify) $(outdir)/index.html
 
 local-web:
        $(MAKE) conf=www local-WWW
@@ -13,9 +12,31 @@ convert-ly: local-convert-ly
        $(LOOP)
 
 local-convert-ly:
-       $(PYTHON) $(script-dir)/convert-ly.py -e *ly
+       $(PYTHON) $(CONVERT_LY) -e *ly
 
 tar:
        mkdir -p $(outdir)/$(tarball)
        cp -p *.ly $(outdir)/$(tarball)
        cd $(outdir) && tar czf $(tarball).tar.gz $(tarball)
+
+png: $(png_examples)
+
+ps: $(ps_examples)
+
+scores: $(score_ps)
+       $(MAKE) ps_examples="$<" ps
+
+mutopia-letter=$(mutopia-examples:%=out-letter/%.ps.gz)
+
+mutopia:
+       $(MAKE) examples="$(mutopia-examples)" PAPERSIZE=letter local-WWW $(mutopia-letter)
+
+local-help:
+       @echo -e "\
+  convert-ly  convert all LilyPond sources\n\
+  mutopia     update PNGs, PostScript a4 and letter of all mutopia-examples\n\
+  png         update PNGs of all examples\n\
+  ps          update PostScript of all examples\n\
+  scores      update PostScript of all scores\n\
+"\
+#
index 154917110b1af7d4a917879fa12702308430853f..b09753c60d6fbd76a7bd2b483089fc3b2a224a25 100644 (file)
@@ -3,6 +3,8 @@
 include $(make-dir)/lilypond-vars.make
 
 LY_FILES = $(wildcard *.ly)
+SCORE_LY_FILES = $(shell fgrep -l score *.ly)
+
 FLY_FILES = $(wildcard *.fly)
 SLY_FILES = $(wildcard *.sly)
 
@@ -29,3 +31,5 @@ name-stem= $(notdir $(basename $<))
 
 OUT_FILES = $(addprefix $(outdir)/,$(M4_FILES:%.m4=%)) \
  $(addprefix $(outdir)/,$(LYM4_FILES:%.lym4=%.ly))
+
+score_ps = $(addprefix $(outdir)/, $(addsuffix .ps.gz, $($SCORE_LY_FILES)))
\ No newline at end of file
index 529facd7694d22bce26f6f3dc9e97f628a10a2d3..e8eca2d4d95f0826aa401904ffc71a1d553ab9d9 100644 (file)
@@ -3,9 +3,8 @@
 depth = ../..
 
 # do Coriolan if you have plenty RAM / CPU / quotum
-examples=
+# examples=coriolan
 
-examples= 
 LOCALSTEPMAKE_TEMPLATES=mutopia
 
 include $(depth)/make/stepmake.make
@@ -14,8 +13,6 @@ parts=$(patsubst %.ly,%,$(wildcard *-part.ly))
 
 tarball=coriolan
 mutopia-examples=coriolan $(parts)
-mutopia-letter=$(mutopia-examples:%=out-letter/%.ps.gz)
 
-mutopia:
-       $(MAKE) examples="$(mutopia-examples)" PAPERSIZE=letter local-WWW $(mutopia-letter)
+
 
index b6a957b27c1b539fec4379e38aa719434841678f..849aeab201a23f83ce1b44d3b590402a513b85ac 100644 (file)
@@ -896,6 +896,7 @@ def system (cmd):
        return st
 
 def compile_all_files (chunks):
+       global foutn
        eps = []
        tex = []
        png = []
@@ -924,23 +925,23 @@ def compile_all_files (chunks):
                                x = os.path.join (g_here_dir, x)
                        return ' -I %s' % x
 
-               incs =  map (incl_opt, include_path)
+               incs = map (incl_opt, include_path)
                lilyopts = string.join (incs, ' ' )
-               texfiles = string.join (tex, ' ')
                if do_deps:
                        lilyopts = lilyopts + ' --dependencies '
-                       #system ('touch %s' % texfiles)
+                       if g_outdir:
+                               lilyopts = lilyopts + '--dep-prefix=' + g_outdir + '/'
+               texfiles = string.join (tex, ' ')
                system ('lilypond --header=texidoc %s %s' % (lilyopts, texfiles))
 
                #
-               # Ugh, fixing up dependencies for outdir/ and .tex generation
+               # Ugh, fixing up dependencies for .tex generation
                #
                if do_deps:
                        depfiles=map (lambda x: re.sub ('(.*)\.ly', '\\1.dep', x), tex)
                        for i in depfiles:
                                text=open (i).read ()
-                               text=re.sub ('\n([^:\n]*):', '\n' + g_outdir + '/' + foutn + ':', text)
-                               text=re.sub (' ([^ /\n]*).ly', ' ' + g_outdir + '/\\1.ly', text)
+                               text=re.sub ('\n([^:\n]*):', '\n' + foutn + ':', text)
                                open (i, 'w').write (text)
 
        for e in eps:
@@ -950,8 +951,7 @@ def compile_all_files (chunks):
                cmd = r"""gs -sDEVICE=pgm  -dTextAlphaBits=4 -dGraphicsAlphaBits=4  -q -sOutputFile=- -r90 -dNOPAUSE %s -c quit | pnmcrop | pnmtopng > %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 <hanwen@cs.uu.nl>
 
 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:
index 3075a506fb120338638ae87653a28e2fdcce5e04..5d97714123d75a6755d1eafd6c5e87947d585e52 100644 (file)
@@ -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)
index f9ee8b35df2d493eecb254be9e8990b17992d841..cf43961a60a1c3af98d5649900bf848d9286d14f 100644 (file)
@@ -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\