]> git.sur5r.net Git - cc65/blob - doc/Makefile
New cbm510 docs by Stefan Haubenthal.
[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         vic20.sgml
50
51 TXT  =  $(SGML:.sgml=.txt)
52 HTML =  $(SGML:.sgml=.html)
53 INFO =  $(SGML:.sgml=.info)
54 DVI  =  $(SGML:.sgml=.dvi)
55 TEX  =  $(SGML:.sgml=.tex)
56
57 # ------------------------------------------------------------------------------
58 # Pattern-rules, to make targets
59
60 %.txt:  %.sgml
61         sgml2txt $(TXT_OPTIONS) $<
62
63 %.html: %.sgml
64         sgml2html --split=1 $(BUTTONS) $<
65
66 %.info: %.sgml
67         sgml2info $<
68
69 %.dvi:  %.sgml
70         sgml2latex $<
71
72 %.tex:  %.sgml
73         sgml2latex --output=tex $<
74
75 # ------------------------------------------------------------------------------
76 # Targets
77
78 .PHONY: all
79 all:    txt html info dvi
80
81 .PHONY: txt
82 txt:    linuxdoc $(TXT)
83
84 .PHONY: html
85 html:   linuxdoc $(HTML)
86
87 .PHONY: info
88 info:   linuxdoc $(INFO)
89
90 .PHONY: dvi
91 dvi:    linuxdoc $(DVI)
92
93 .PHONY: tex
94 tex:    linuxdoc $(TEX)
95
96 .PHONY: linuxdoc
97 linuxdoc:
98         @sgmlcheck index >/dev/null 2>&1 || { \
99         echo; \
100         echo '"LinuxDoc Tools" does not exist on this system.'; \
101         echo 'So, most of the documentation might not have been built.'; \
102         echo; \
103         false;}
104
105 .PHONY: clean
106 clean:
107         $(RM) *~
108
109 .PHONY: zap
110 zap:    clean
111         $(RM) $(TXT) $(TEX) $(DVI) *.htm* *.inf* *.man
112
113 # ------------------------------------------------------------------------------
114 # Special target rules
115                          
116 coding.html:    coding.sgml
117         sgml2html --split=0 $<
118
119 # funcref.sgml's third section is huge.
120 # So, funcref.html is split into sub-section files.
121 #
122 funcref.html:   funcref.sgml
123         sgml2html --split=2 $(BUTTONS) $<
124
125 # The index.html target is special:
126 # It is only a table of contents.  So, it should not be split.
127 #
128 index.html:     index.sgml
129         sgml2html --split=0 $<