]> git.sur5r.net Git - cc65/blob - doc/Makefile
Makefile changes by Greg King
[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         ar65.sgml       \
21         atari.sgml      \
22         atmos.sgml      \
23         c128.sgml       \
24         c16.sgml        \
25         c64.sgml        \
26         ca65.sgml       \
27         ca65html.sgml   \
28         cbm610.sgml     \
29         cc65.sgml       \
30         cl65.sgml       \
31         co65.sgml       \
32         coding.sgml     \
33         da65.sgml       \
34         debugging.sgml  \
35         dio.sgml        \
36         funcref.sgml    \
37         geos.sgml       \
38         grc.sgml        \
39         index.sgml      \
40         intro.sgml      \
41         ld65.sgml       \
42         library.sgml    \
43         lynx.sgml       \
44         nes.sgml        \
45         pet.sgml        \
46         plus4.sgml      \
47         vic20.sgml
48
49 TXT  =  $(SGML:.sgml=.txt)
50 HTML =  $(SGML:.sgml=.html)
51 INFO =  $(SGML:.sgml=.info)
52 DVI  =  $(SGML:.sgml=.dvi)
53 TEX  =  $(SGML:.sgml=.tex)
54
55 # ------------------------------------------------------------------------------
56 # Pattern-rules, to make targets
57
58 %.txt:  %.sgml
59         sgml2txt $(TXT_OPTIONS) $<
60
61 %.html: %.sgml
62         sgml2html --split=1 $(BUTTONS) $<
63
64 %.info: %.sgml
65         sgml2info $<
66
67 %.dvi:  %.sgml
68         sgml2latex $<
69
70 %.tex:  %.sgml
71         sgml2latex --output=tex $<
72
73 # ------------------------------------------------------------------------------
74 # Targets
75
76 .PHONY: all
77 all:    txt html info dvi
78
79 .PHONY: txt
80 txt:    linuxdoc $(TXT)
81
82 .PHONY: html
83 html:   linuxdoc $(HTML)
84
85 .PHONY: info
86 info:   linuxdoc $(INFO)
87
88 .PHONY: dvi
89 dvi:    linuxdoc $(DVI)
90
91 .PHONY: tex
92 tex:    linuxdoc $(TEX)
93
94 .PHONY: linuxdoc
95 linuxdoc:
96         @sgmlcheck index >/dev/null 2>&1 || { \
97         echo; \
98         echo '"LinuxDoc Tools" does not exist on this system.'; \
99         echo 'So, most of the documentation might not have been built.'; \
100         echo; \
101         false;}
102
103 .PHONY: clean
104 clean:
105         $(RM) *~
106
107 .PHONY: zap
108 zap:    clean
109         $(RM) $(TXT) $(TEX) $(DVI) *.htm* *.inf* *.man
110
111 # ------------------------------------------------------------------------------
112 # Special target rules
113
114 coding.html:    coding.sgml
115         sgml2html --split=0 $<
116
117 # funcref.sgml's third section is huge.
118 # So, funcref.html is split into sub-section files.
119 #
120 funcref.html:   funcref.sgml
121         sgml2html --split=2 $(BUTTONS) $<
122
123 # The index.html target is special:
124 # It is only a table of contents.  So, it should not be split.
125 #
126 index.html:     index.sgml
127         sgml2html --split=0 $<