]> git.sur5r.net Git - cc65/blob - doc/Makefile
Use new syntax for call to linuxdoc.
[cc65] / doc / Makefile
1 # -*- makefile -*-
2 #
3 # Makefile for the cc65 documentation
4 #
5
6 # You can put navigation-arrow pictures (next, back, contents) into HTML files
7 # by setting this variable, either here or on make's command-line.
8 # (You will need to copy the .png files from "share/doc/linuxdoc-tools*/html/".)
9 #
10 #BUTTONS=-I
11
12 # These options decide how text files are made:
13 # -f -- removes the backspace-overtyping that makes bold text
14 #       in the more/less commands and on typewriter-printers
15 # -m -- makes Unix manual pages
16 #
17 #TXT_OPTIONS=-f -m
18
19 SGML =  apple2.sgml     \
20         apple2enh.sgml  \
21         ar65.sgml       \
22         atari.sgml      \
23         atmos.sgml      \
24         c128.sgml       \
25         c16.sgml        \
26         c64.sgml        \
27         ca65.sgml       \
28         ca65html.sgml   \
29         cbm510.sgml     \
30         cbm610.sgml     \
31         cc65.sgml       \
32         cl65.sgml       \
33         co65.sgml       \
34         coding.sgml     \
35         da65.sgml       \
36         debugging.sgml  \
37         dio.sgml        \
38         funcref.sgml    \
39         geos.sgml       \
40         grc.sgml        \
41         index.sgml      \
42         intro.sgml      \
43         ld65.sgml       \
44         library.sgml    \
45         lynx.sgml       \
46         nes.sgml        \
47         pet.sgml        \
48         plus4.sgml      \
49         supervision.sgml\
50         vic20.sgml
51
52 TXT  =  $(SGML:.sgml=.txt)
53 HTML =  $(SGML:.sgml=.html)
54 INFO =  $(SGML:.sgml=.info)
55 DVI  =  $(SGML:.sgml=.dvi)
56 TEX  =  $(SGML:.sgml=.tex)
57
58 # ------------------------------------------------------------------------------
59 # Pattern-rules, to make targets
60
61 %.txt:  %.sgml
62         linuxdoc -B txt -f $(TXT_OPTIONS) $<
63
64 %.html: %.sgml
65         linuxdoc -B info --split=1 $(BUTTONS) $<
66
67 %.info: %.sgml
68         linuxdoc -B info $<
69
70 %.dvi:  %.sgml
71         linuxdoc -B latex --output=dvi $<
72
73 %.tex:  %.sgml
74         linuxdoc -B latex --output=tex $<
75
76 # ------------------------------------------------------------------------------
77 # Targets
78
79 .PHONY: all
80 all:    txt html info dvi
81
82 .PHONY: txt
83 txt:    linuxdoc $(TXT)
84
85 .PHONY: html
86 html:   linuxdoc $(HTML)
87
88 .PHONY: info
89 info:   linuxdoc $(INFO)
90
91 .PHONY: dvi
92 dvi:    linuxdoc $(DVI)
93
94 .PHONY: tex
95 tex:    linuxdoc $(TEX)
96
97 .PHONY: linuxdoc
98 linuxdoc:
99         @sgmlcheck index >/dev/null 2>&1 || { \
100         echo; \
101         echo '"LinuxDoc Tools" does not exist on this system.'; \
102         echo 'So, most of the documentation might not have been built.'; \
103         echo; \
104         false;}
105
106 .PHONY: clean
107 clean:
108         $(RM) *~
109
110 .PHONY: zap
111 zap:    clean
112         $(RM) $(TXT) $(TEX) $(DVI) *.htm* *.inf* *.man
113
114 # ------------------------------------------------------------------------------
115 # Special target rules
116
117 coding.html:    coding.sgml
118         sgml2html --split=0 $<
119
120 # funcref.sgml's third section is huge.
121 # So, funcref.html is split into sub-section files.
122 #
123 funcref.html:   funcref.sgml
124         sgml2html --split=2 $(BUTTONS) $<
125
126 # The index.html target is special:
127 # It is only a table of contents.  So, it should not be split.
128 #
129 index.html:     index.sgml
130         sgml2html --split=0 $<