]> git.donarmstrong.com Git - lilypond.git/commitdiff
Write *-systems.tex* as last act. Obviates the '% eof' grep.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 18:27:37 +0000 (19:27 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 18:27:37 +0000 (19:27 +0100)
make/ly-rules.make
scm/framework-eps.scm

index 8b59dc9619f2894321ddfbb13cc1fdc5ef7d3a95..2e9e5ff0224f7f2eaa02b62553fd417297d28925 100644 (file)
@@ -7,12 +7,10 @@ $(outdir)/%.latex:  %.doc
 # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
 # it is not, for --srcdir builds
 $(outdir)/%.texi: %.tely
-       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
 
 
 $(outdir)/%.texi: $(outdir)/%.tely
-       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
 #
 # DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE.
index f7003bac2aa6fdf23edad3fb429d5810e41f2a0d..cf9bec54b30888aa08fc3526bcecb2a24fa8596a 100644 (file)
@@ -82,18 +82,22 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
          (dump-stencils-as-separate-EPS rest (1+ count)))))
 
   ;; main body 
-  (let* ((tex-system-name (format "~a-systems.tex" basename))
-        (texi-system-name (format "~a-systems.texi" basename))
-        (tex-system-port (open-output-file tex-system-name))
-        (texi-system-port (open-output-file texi-system-name))
+  (let* ((write-file (lambda (str-port ext)
+                      (let*
+                          ((name (format "~a-systems.~a" basename ext))
+                           (port (open-output-file name)))
+                        (ly:message (_ "Writing ~a...") name)
+                        (display (get-output-string str-port) port)
+                        (close-output-port port)
+                        )))
+        
+        (tex-system-port (open-output-string))
+        (texi-system-port (open-output-string))
         (widened-stencils (widen-left-stencil-edges stencils))
         (counted-systems  (count-list widened-stencils))
         (eps-files (map dump-counted-stencil  counted-systems))
         )
     
-    (ly:message (_ "Writing ~a...") tex-system-name)
-    (ly:message (_ "Writing ~a...") texi-system-name)
-
     (if do-pdf
 
        ;; par-for-each: a bit faster ...  
@@ -116,15 +120,16 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
                                 basename (1+ c)) texi-system-port))
              (iota (length stencils)))
     
-    (display "@c eof - 'eof' is a Makefile marker; do not remove. " texi-system-port)
-    (display "% eof - 'eof' is Makefile marker; do not remove. " tex-system-port)
-    
-    (close-output-port texi-system-port)
-    (close-output-port tex-system-port)
+    (display "@c eof." texi-system-port)
+    (display "% eof. " tex-system-port)
     
     (dump-infinite-stack-EPS stencils)
     (postprocess-output book framework-eps-module
-                       (format "~a.eps" basename) (ly:output-formats))))
+                       (format "~a.eps" basename) (ly:output-formats))
+
+    (write-file texi-system-port "texi")
+    (write-file tex-system-port "tex")
+    ))