]> git.donarmstrong.com Git - lilypond.git/blobdiff - make/lilypond-book-rules.make
Add '-dcrop' option to ps and svg backends
[lilypond.git] / make / lilypond-book-rules.make
index 3bdcf477455050bcf50b2bdb7d3a2cf0f0199e16..243a9f18c789f25167589ca2fc72a9667932d5eb 100644 (file)
@@ -1,13 +1,21 @@
-.SUFFIXES: .html .xml .lytex .tex .latex
+.SUFFIXES: .html .xml .lytex .tex .latex .lyxml .tely .texi .texinfo
+
+############## HTML #########################
 
 $(outdir)/%.html:  %.html
        $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
 
+$(outdir)/%.html:  %.htmly
+       $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
+
 $(outdir)/%.html:  %.xml
        $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
 
+
+############## LaTeX ########################
+
 $(outdir)/%.tex:  %.lytex
-       $(LILYPOND_BOOK_COMMAND) --pdf -o $(outdir) $<
+       $(buildscript-dir)/run-and-check "$(LILYPOND_BOOK_COMMAND) --pdf -o $(outdir) $<"  "$*.lytex.log"
 
 $(outdir)/%.tex:  %.tex
        $(LILYPOND_BOOK_COMMAND) --pdf -o $(outdir) $<
@@ -15,5 +23,46 @@ $(outdir)/%.tex:  %.tex
 $(outdir)/%.tex:  %.latex
        $(LILYPOND_BOOK_COMMAND) --pdf -o $(outdir) $<
 
+# Add the tex => pdf rule only if we have pdflatex
+ifeq (,$(findstring pdflatex,$(MISSING_OPTIONAL)))
 $(outdir)/%.pdf:  $(outdir)/%.tex
-       cd $(outdir) && pdflatex $(notdir $<)
+       cd $(outdir) && $(buildscript-dir)/run-and-check "$(PDFLATEX) -halt-on-error $(notdir $<)" "$*.pdflatex.log"
+ifeq ($(USE_EXTRACTPDFMARK),yes)
+       $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
+       $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+       rm $@
+       mv $(outdir)/$*.final.pdf $@
+endif
+endif
+
+############## Texinfo ######################
+
+$(outdir)/%.texi:  %.texi
+       $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
+
+$(outdir)/%.texi:  %.itexi
+       $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
+
+$(outdir)/%.texi:  %.texinfo
+       $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
+
+$(outdir)/%.texi:  %.tely
+       $(LILYPOND_BOOK_COMMAND) -o $(outdir) $<
+
+
+############## DocBook ######################
+
+$(outdir)/%.xml:  %.lyxml
+       $(LILYPOND_BOOK_COMMAND) --pdf -o $(outdir) $<
+
+# Add the xml => pdf rule only if we have dblatex
+ifeq (,$(findstring dblatex,$(MISSING_OPTIONAL)))
+$(outdir)/%.pdf:  $(outdir)/%.xml
+       cd $(outdir) && $(buildscript-dir)/run-and-check "$(DBLATEX) $(DBLATEX_BACKEND) $(notdir $<)" "$*.dblatex.log"
+ifeq ($(USE_EXTRACTPDFMARK),yes)
+       $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
+       $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+       rm $@
+       mv $(outdir)/$*.final.pdf $@
+endif
+endif