]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/GNUmakefile
Add '-dcrop' option to ps and svg backends
[lilypond.git] / Documentation / GNUmakefile
index 9b598c923ac1f0107ae6e9feab0ee4eb36c85850..c1a194b54b09198fd6531eded970b61753936e80 100644 (file)
@@ -9,10 +9,8 @@ depth = ..
 
 NAME = documentation
 LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
-MANUALS_SUBDIRS = usage contributor essay \
-  web learning notation extending
-SUBDIRS = $(MANUALS_SUBDIRS) snippets logo pictures misc po css topdocs \
-  included $(LANGS)
+SUBDIRS = logo pictures misc po css topdocs \
+  ly-examples $(LANGS)
 STEPMAKE_TEMPLATES = documentation texinfo tex omf
 LOCALSTEPMAKE_TEMPLATES = lilypond ly
 
@@ -23,16 +21,15 @@ TEXI2PDF_FLAGS = \
   -I $(outdir) \
   -I $(top-build-dir)/Documentation/$(outconfbase)
 $(outdir)/snippets-big-page.html: TEXI2HTML_FLAGS += -D short_toc
-$(outdir)/snippets/index..html: TEXI2HTML_FLAGS += -D short_toc
+$(outdir)/snippets/index.html: TEXI2HTML_FLAGS += -D short_toc
 
 ### Extra source files
 
-README_TOP_FILES= DEDICATION THANKS
+README_TOP_FILES= DEDICATION
 
 IN_ITELY_FILES = $(call src-wildcard,snippets/*-intro.itely)
 SNIPPET_LY_FILES = $(call src-wildcard,snippets/*.ly)
-
-EXTRA_DIST_FILES = $(call src-wildcard,*.init) $(call src-wildcard,*.bst)
+OUT_SNIPPET_LY_FILES = $(SNIPPET_LY_FILES:%.ly=out/%.ly)
 
 ### Out files
 
@@ -89,6 +86,13 @@ endif
 
 include $(depth)/make/stepmake.make
 
+DOCUMENTATION_INCLUDES += -I $(outdir) \
+  -I $(top-build-dir)/Documentation/snippets/out \
+  -I $(top-src-dir)/Documentation/included \
+  -I $(top-src-dir)/Documentation/pictures \
+  -I $(top-src-dir)/Documentation \
+  -I $(top-src-dir)/input/regression
+
 OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
 
 
@@ -98,7 +102,6 @@ $(XREF_MAPS_DIR)/web.xref-map: XREF_MAP_FLAGS += --split=node
 ### AJAX scripts
 JS_FILES = $(call src-wildcard,*.js)
 PHP_FILES = $(call src-wildcard,*.php)
-EXTRA_DIST_FILES += $(JS_FILES) $(PHP_FILES)
 
 OUT_JS_FILES = $(JS_FILES:%.js=$(outdir)/%.js)
 OUT_PHP_FILES = $(PHP_FILES:%.php=$(outdir)/%.php)
@@ -115,18 +118,21 @@ $(outdir)/colorado.itexi:
        BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
                -s $(top-src-dir)/Documentation/lily-bib \
                -o $(outdir)/colorado.itexi \
+               -q \
                $(src-dir)/essay/colorado.bib
 
 $(outdir)/computer-notation.itexi:
        BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
                -s $(top-src-dir)/Documentation/lily-bib \
                -o $(outdir)/computer-notation.itexi \
+               -q \
                $(src-dir)/essay/computer-notation.bib
 
 $(outdir)/engravingbib.itexi:
        BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \
                -s $(top-src-dir)/Documentation/lily-bib \
                -o $(outdir)/engravingbib.itexi \
+               -q \
                $(src-dir)/essay/engravingbib.bib
 
 $(outdir)/essay.texi: \
@@ -134,18 +140,6 @@ $(outdir)/essay.texi: \
   $(outdir)/computer-notation.itexi \
   $(outdir)/engravingbib.itexi
 
-$(outdir)/others-did.itexi:
-       BSTINPUTS=$(src-dir)/web/ $(buildscript-dir)/bib2texi \
-               -s $(top-src-dir)/Documentation/lily-bib \
-               -o $(outdir)/others-did.itexi \
-               $(src-dir)/web/others-did.bib
-
-$(outdir)/we-wrote.itexi:
-       BSTINPUTS=$(src-dir)/web/ $(buildscript-dir)/bib2texi \
-               -s $(top-src-dir)/Documentation/lily-bib \
-               -o $(outdir)/we-wrote.itexi \
-               $(src-dir)/web/we-wrote.bib
-
 
 ###########
 ### Targets
@@ -180,8 +174,6 @@ extra-local-help:
        @echo
 
 info: $(INFO_FILES)
-       @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
-       @echo export PYTHONPATH=$(PYTHONPATH)
 
 xml: $(outdir)/notation/notation.xml $(outdir)/internals/internals.xml
 
@@ -206,51 +198,51 @@ endif
 #########
 ### Rules
 
-$(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi $(outdir)/weblinks.itexi
-       $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $<
+$(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi $(outdir)/weblinks.itexi | $(OUT_TEXINFO_MANUALS)
+       $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $<"  "$*.makeinfo.log"
+
+txt-to-html: $(OUT_TXT_FILES) $(OUT_TXT_FILES:%.txt=%.html)
 
-# cd $(outdir) rule gets bit hairy for --srcdir configure builds
-txt-to-html:
-       $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
-       $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
+$(OUT_TXT_FILES): $(outdir)/%.txt: $(top-src-dir)/%
+       cp -f $< $@
+
+$(OUT_TXT_FILES:%.txt=%.html): $(outdir)/%.html: $(outdir)/%.txt
+       $(buildscript-dir)/text2html $<
+
+# Explicitly list the dependencies on generated content
+$(outdir)/web.texi: $(outdir)/we-wrote.itexi $(outdir)/others-did.itexi $(outdir)/weblinks.itexi $(outdir)/version.itexi
 
 ifeq ($(out),www)
 ## Extra images dependencies
 $(OUT_TEXINFO_MANUALS): $(outdir)/pictures
 
 $(outdir)/pictures:
-       $(MAKE) -C pictures WWW-1
+       $(MAKE) -C pictures out=www WWW-1
        ln -sf ../pictures/$(outdir) $@
 
-$(outdir)/ly-examples:
-       $(MAKE) -C web/ly-examples
-       ln -sf ../web/ly-examples/$(outdir) $@
-endif
+$(outdir)/web.texi: $(outdir)/css $(outdir)/ly-examples
 
-ifeq ($(out),www)
-$(outdir)/web.texi: $(outdir)/ly-examples $(outdir)/we-wrote.itexi $(outdir)/others-did.itexi
-else
-# duplicate (without ly-examples)
-$(outdir)/web.texi: $(outdir)/we-wrote.itexi $(outdir)/others-did.itexi
+$(outdir)/css:
+       $(MAKE) -C css out=www WWW-1
+       ln -sf ../css/$(outdir) $@
+
+$(outdir)/ly-examples:
+       $(MAKE) -C ly-examples out=www WWW-1
+       ln -sf ../ly-examples/$(outdir) $@
 endif
 
 
 # Ugh, using '%' twice not possible
 $(outdir)/notation/notation.xml: $(outdir)/notation.texi
        mkdir -p $(dir $@)
-       $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
+       $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<"  "$*.makeinfoxml.log"
 
 $(outdir)/internals/internals.xml: $(outdir)/internals.texi
        mkdir -p $(dir $@)
-       $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<
+       $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --docbook $<"  "$*.makeinfoxml.log"
 
 $(outdir)/learning.texi $(outdir)/notation.texi: $(OUT_PDF_IMAGES)
 
-$(foreach manual, $(MANUAL_SUBDIRS),\
-$(eval $(outdir)/(manual).texi: $(call src-wildcard,$(manual)/*.ite??)))
-
-
-
 $(outdir)/source:
        @rm -f $(@)
        ln -sf $(depth) $(@)
@@ -265,7 +257,15 @@ $(outdir)/%/source:
 $(outdir)/%.itely: snippets/%-intro.itely snippets/%.snippet-list
        xargs $(LYS_TO_TELY) -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
 
-$(outdir)/snippets.texi: $(GENERATED_ITELY_FILES) $(SNIPPET_LY_FILES)
+$(TEXI_FILES_FROM_TELY): $(GENERATED_ITELY_FILES) $(OUT_SNIPPET_LY_FILES)
+
+$(OUT_SNIPPET_LY_FILES): out/ly-snippets.dep
+
+out/ly-snippets.dep: $(SNIPPET_LY_FILES)
+       mkdir -p snippets/out
+       $(buildscript-dir)/makesnippets $(src-dir)/snippets snippets/out $(src-dir)
+       mkdir -p out
+       touch $@
 
 $(outdir)/%.bib: %.bib
        ln -f $< $@
@@ -280,7 +280,7 @@ $(outdir)/%.php: %.php
 $(top-build-dir)/mf/$(outconfbase)/feta16list.ly:
        $(MAKE) -C $(top-src-dir)/mf
 
-$(outdir)/notation.texi: $(outdir)/ly-grammar.txt
+$(outdir)/contributor.texi: $(outdir)/ly-grammar.txt
 
 ## Rules for the automatically generated documentation
 $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
@@ -291,9 +291,8 @@ $(outdir)/ly-grammar.txt: $(top-src-dir)/lily/parser.yy
 # of internals every time.  however, this triggers
 # compilation during install, which is a bad thing (tm).
 
-$(outdir)/internals.texi: $(LILYPOND_BINARY)
-       cd $(outdir) && $(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation
-
+$(outdir)/internals.texi: $(LILYPOND_BINARY) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
+       cd $(outdir) && $(buildscript-dir)/run-and-check "$(LILYPOND_BINARY) --verbose $(top-src-dir)/ly/generate-documentation" "generate-documentation.log"
 
 ###############################################
 #  Documentation and translations maintenance #
@@ -311,9 +310,6 @@ endif
 ifneq ($(ISOLANG),)
 new-lang-dir:
        mkdir -p $(ISOLANG)/$(DIR)
-       cp fr/GNUmakefile $(ISOLANG)
-       cp fr/$(DIR)/GNUmakefile $(ISOLANG)/$(DIR)
-       sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/$(DIR)/GNUmakefile
        rm -f $(outdir)/*.*tely $(outdir)/*.*texi
        $(PYTHON) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext $$(cd $(ISOLANG) && ls -1 ../$(DIR).tely ../$(DIR).texi)
        for i in $$(cd $(outdir) && ls -1 $(DIR).tely $(DIR).texi); do\
@@ -328,7 +324,10 @@ new-lang-dir:
 
 new-lang:
 # Also for updating/adding missing files
-       mkdir -p $(ISOLANG)
+       mkdir -p $(ISOLANG)/included
+       if test -z "`ls $(ISOLANG)/included`"; then touch $(ISOLANG)/included/.gitignore; fi
+       cp fr/GNUmakefile $(ISOLANG)
+       sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile
        $(foreach i,$(TRANSLATION_DIRS),$(MAKE) new-lang-dir DIR=$(i) &&) :
        msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
        test -e po/$(ISOLANG).po || cp po/lilypond-doc.pot po/$(ISOLANG).po
@@ -383,5 +382,3 @@ update-translation:
 # what's it gonna be, boy...tranlationS-/translation-
 translation-status:
        PYTHONPATH=$(top-src-dir)/python:$(top-src-dir)/python/auxiliar $(PYTHON) $(top-src-dir)/scripts/auxiliar/translations-status.py
-
-.SECONDARY: