]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/texinfo-rules.make
05627f18dab6eb598cd0fab9c76fc546fc93ac54
[lilypond.git] / stepmake / stepmake / texinfo-rules.make
1
2 .SUFFIXES: .html .info .texi .texinfo
3
4 # "makeinfo --info" MUST be able to read PNGs from CWD for info images
5 # to work, hence $(INFO_IMAGES_DIR) -> $(outdir)/ symlink.
6 # $(outdir)/$(INFO_IMAGES_DIR)/*.png symlinks are only needed to view
7 # out-www/*.info with Emacs -- HTML docs no longer need these
8 # symlinks, see replace_symlinks_urls in
9 # python/auxiliar/postprocess_html.py.
10
11 # make dereferences symlinks, and $(INFO_IMAGES_DIR) is a symlink
12 # to $(outdir), so we can't use directly $(INFO_IMAGES_DIR) as a
13 # prerequisite, otherwise %.info are always outdated (because older
14 # than $(outdir)), hence this .dep file
15
16 $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep: $(INFO_DOCS:%=$(outdir)/%.texi)
17 ifneq ($(INFO_IMAGES_DIR),)
18         rm -f $(INFO_IMAGES_DIR)
19         ln -s $(outdir) $(INFO_IMAGES_DIR)
20         mkdir -p $(outdir)/$(INFO_IMAGES_DIR)
21         rm -f $(outdir)/$(INFO_IMAGES_DIR)/[a-f0-9][a-f0-9]
22         cd $(outdir)/$(INFO_IMAGES_DIR) && $(buildscript-dir)/mass-link symbolic .. . [a-f0-9][a-f0-9]
23 endif
24         touch $@
25
26 $(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi
27         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $<
28
29 ifeq (,$(findstring texi2html,$(MISSING_OPTIONAL)))
30 $(outdir)/%-big-page.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi
31         $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $<
32         cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
33
34 $(outdir)/%.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi
35         $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $<
36         cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
37
38 $(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi
39         mkdir -p $(dir $@)
40         $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
41         cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
42
43 else # Rules using makeinfo follow
44 $(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/version.itexi
45         $(MAKEINFO) -I$(src-dir) -I $(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
46
47 $(outdir)/%.html: $(outdir)/%.texi $(outdir)/version.itexi
48         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
49
50 $(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.itexi
51         mkdir -p $(dir $@)
52         $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$(dir $@) --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
53 endif
54
55 $(outdir)/%.html.omf: %.texi
56         $(call GENERATE_OMF,html)
57
58 $(outdir)/%.pdf.omf: %.texi
59         $(call GENERATE_OMF,pdf)
60
61 $(outdir)/%.ps.gz.omf: %.texi
62         $(call GENERATE_OMF,ps.gz)
63
64 $(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.itexi
65         cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
66
67 $(outdir)/%.txt: $(outdir)/%.texi $(outdir)/version.itexi
68         $(MAKEINFO) -I$(src-dir) -I$(outdir) --no-split --no-headers --output $@ $<
69
70 $(outdir)/%.texi: %.texi
71         rm -f $@
72         cp $< $@
73
74 $(XREF_MAPS_DIR)/%.xref-map: $(outdir)/%.texi
75         $(buildscript-dir)/extract_texi_filenames -o $(XREF_MAPS_DIR) $<
76
77
78 $(outdir)/version.%: $(top-src-dir)/VERSION
79         echo '@macro version'> $@
80         echo $(TOPLEVEL_VERSION)>> $@
81         echo '@end macro'>> $@
82
83 .SECONDARY: $(outdir)/version.itexi $(outdir)/version.texi \
84   $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep