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