]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/stepmake/texinfo-rules.make
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into dev...
[lilypond.git] / stepmake / stepmake / texinfo-rules.make
index 1430de5905888d6e7286b435981da0c4fa917691..0db8472d553e69bd9c15118cf193537c8a52cc84 100644 (file)
@@ -1,38 +1,77 @@
 
 .SUFFIXES: .html .info .texi .texinfo
 
-$(outdir)/%.info: $(outdir)/%.texi
-       $(MAKEINFO) -I $(outdir) --output=$@ $<
+# "makeinfo --info" MUST be able to read PNGs from CWD for info images
+# to work, hence $(INFO_IMAGES_DIR) -> $(outdir)/ symlink.
+# $(outdir)/$(INFO_IMAGES_DIR)/*.png symlinks are only needed to view
+# out-www/*.info with Emacs -- HTML docs no longer need these
+# symlinks, see replace_symlinks_urls in
+# buildscripts/add_html_footer.py.
+
+ifneq ($(INFO_IMAGES_DIR),)
+
+# make dereferences symlinks, and $(INFO_IMAGES_DIR) is a symlink
+# to $(outdir), so we can't use directly $(INFO_IMAGES_DIR) as a
+# prerequisite, otherwise %.info are always outdated (because older
+# than $(outdir), hence this .dep file
+
+$(outdir)/%.info-images-dir.dep: $(outdir)/%.texi
+       rm -f $*
+       ln -s $(outdir) $*
+       mkdir -p $(outdir)/$*
+       find $(outdir)/$*/ -name '*'.png | xargs rm -f
+       (cd $(outdir)/$*/ ; ln -sf ../*.png . )
+       touch $@
+
+else
+
+$(outdir)/.info-images-dir.dep:
+       touch $@
+
+endif
+
+# Settings for texi2html:
+ifneq ($(ISOLANG),) 
+TEXI2HTML_LANG = --lang=$ISOLANG
+endif
+TEXI2HTML_FLAGS += --css-ref=lilypond.css $(DOCUMENTATION_INCLUDES)
+TEXI2HTML = $(TEXI2HTML_PROGRAM) $(TEXI2HTML_FLAGS) $(TEXI2HTML_LANG)
+
+
+
+$(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir.dep
+       $(MAKEINFO) -I$(outdir) --output=$@ $<
+
+
+$(outdir)/%/index.html: $(outdir)/%.texi
+       mkdir -p $(dir $@)
+       $(TEXI2HTML) --I=$(outdir) --output=$(dir $@) --prefix=init --split=section $(TEXI2HTML_INIT) $<
+
+# TODO: Pass -D bigpage to texi2html
+$(outdir)/%-big-page.html: $(outdir)/%.texi
+       $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $< 
 
 $(outdir)/%.html: $(outdir)/%.texi
-       $(MAKEINFO) -I $(outdir) --output=$@ --html --no-split --no-headers $<
-# we want footers even if website builds (or is built) partly
-       $(footify) $@
+       $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $<
 
-$(outdir)/%.html.omf: $(outdir)/%.texi
-       $(GENERATE_OMF) --format html --location $(local_package_docdir)/$(current-relative-dir)/$(notdir $(basename $@))  --version $(TOPLEVEL_VERSION) $< > $@
-$(outdir)/%.pdf.omf: $(outdir)/%.texi
-       $(GENERATE_OMF) --format pdf --location $(local_package_docdir)/$(current-relative-dir)/$(notdir $(basename $@))  --version $(TOPLEVEL_VERSION) $< > $@
+$(outdir)/%.html.omf: %.texi
+       $(call GENERATE_OMF,html)
 
-$(outdir)/%.ps.gz.omf: $(outdir)/%.texi
-       $(GENERATE_OMF) --format ps.gz --location $(local_package_docdir)/$(current-relative-dir)/$(notdir $(basename $@))  --version $(TOPLEVEL_VERSION) $< > $@
+$(outdir)/%.pdf.omf: %.texi
+       $(call GENERATE_OMF,pdf)
 
-# Generic rule not possible?
-$(outdir)/%/%.html: $(outdir)/%.texi
-       $(MAKEINFO) --output=$@ --html $<
-# we want footers even if website builds (or is built) partly
-       $(deep-footify) $(sort $(wildcard $(outdir)/$(*F)/*.html))
+$(outdir)/%.ps.gz.omf: %.texi
+       $(call GENERATE_OMF,ps.gz)
 
-$(outdir)/%.dvi: $(outdir)/%.texi
-       cd $(outdir); texi2dvi --batch $(<F)
+$(outdir)/%.pdf: $(outdir)/%.texi
+       cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
 
 $(outdir)/%.txt: $(outdir)/%.texi
-       $(MAKEINFO) -I $(pwd) -I $(outdir) --no-split --no-headers --output $@ $<
+       $(MAKEINFO) -I $(src-dir) -I $(outdir) --no-split --no-headers --output $@ $<
 
 $(outdir)/%.texi: %.texi
        rm -f $@
        cp $< $@
-       chmod -w $@