]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/stepmake/texinfo-rules.make
Rework @version macro
[lilypond.git] / stepmake / stepmake / texinfo-rules.make
index a1f223b4c42b6ff1cfd6c379b5973793133972cb..f676dc69f2716083693cc1fb1dcee042b2be79c8 100644 (file)
@@ -1,41 +1,73 @@
-# Texinfo_rules.make
-
-.SUFFIXES: .1 .html .texinfo
-
-texi2man = $(step-bindir)/out/texi2man $< $@
-texi2html =\
-    rm -f $@.urg;\
-    cat $< | sed "s!@include.*!!" > $@.urg;\
-    $(TEXI2HTML) $@.urg;\
-    rm -f $@.urg;\
-    mv $(@F).urg.html $@;\
-    rm -f $(@F:%.html=%.html.urg_toc.html);\
-    add-URLs $@
-
-$(outdir)/%.1: %.texinfo
-       $(texi2man)
-
-# $(outdir)/%.info: %.texinfo
-#      $(MAKEINFO) -o $@ $<
-
-$(outdir)/%.info: $(outdir)/%.texinfo
-       $(MAKEINFO) -o $@ $<
-
-# $(outdir)/%.html: %.texinfo
-#      $(texi2html)
-#      add-html-footer --index $(depth)/../index.html $@
-
-# texi2html is as broken as pod2html 5004 :-) 
-# we'll have to use pod2html 5003 for now.
-# don't burn your .pod sources!
-#
-$(outdir)/%.html: $(outdir)/%.texinfo
-       $(texi2html)
-       $(PYTHON) $(step-bindir)/add-html-footer.py --package=$(topdir) --index $(depth)/../index.html $@
-
-$(outdir)/%.texinfo: %.texinfo
+
+.SUFFIXES: .html .info .texi .texinfo
+
+# "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
+
+$(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir.dep $(outdir)/version.texi
+       $(MAKEINFO) -I$(outdir) --output=$@ $<
+
+
+$(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.texi
+       mkdir -p $(dir $@)
+       $(TEXI2HTML) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
+       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+
+$(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/version.texi
+       $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< 
+       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+
+$(outdir)/%.html: $(outdir)/%.texi $(outdir)/version.texi
+       $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $<
+       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
+
+$(outdir)/%.html.omf: %.texi
+       $(call GENERATE_OMF,html)
+
+$(outdir)/%.pdf.omf: %.texi
+       $(call GENERATE_OMF,pdf)
+
+$(outdir)/%.ps.gz.omf: %.texi
+       $(call GENERATE_OMF,ps.gz)
+
+$(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.texi
+       cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
+
+$(outdir)/%.txt: $(outdir)/%.texi $(outdir)/version.texi
+       $(MAKEINFO) -I $(src-dir) -I $(outdir) --no-split --no-headers --output $@ $<
+
+$(outdir)/%.texi: %.texi
+       rm -f $@
        cp $< $@
 
-$(outdir)/%.1: $(outdir)/%.texinfo
-       -$(texi2man)
+$(outdir)/version.%: $(top-src-dir)/VERSION
+       echo '@macro version'> $@
+       echo $(TOPLEVEL_VERSION)>> $@
+       echo '@end macro'>> $@