Imported from ../bash-2.03.tar.gz.
[platform/upstream/bash.git] / doc / Makefile.in
1 # This Makefile is for the Bash/documentation directory -*- text -*-.
2 #
3 SHELL = @MAKE_SHELL@
4 RM          = rm -f
5
6 topdir = @top_srcdir@
7 srcdir = @srcdir@
8 VPATH = .:@srcdir@
9
10 infodir = @infodir@
11
12 mandir = @mandir@
13 manpfx = man
14
15 man1ext = 1
16 man1dir = $(mandir)/$(manpfx)$(man1ext)
17 man3ext = 3
18 man3dir = $(mandir)/$(manpfx)$(man3ext) 
19
20 INSTALL = @INSTALL@
21 INSTALL_DATA = @INSTALL_DATA@
22 BUILD_DIR = @BUILD_DIR@
23
24 # bad style
25 RL_LIBDIR = $(topdir)/lib/readline
26
27 # unused
28 TEXINDEX    = texindex
29 TEX         = tex
30
31 MAKEINFO    = makeinfo
32 TEXI2DVI    = ${topdir}/support/texi2dvi
33 TEXI2HTML   = ${topdir}/support/texi2html
34 MAN2HTML    = ${BUILD_DIR}/support/man2html
35 HTMLPOST    = ${srcdir}/htmlpost.sh
36 QUIETPS     = #set this to -q to shut up dvips
37 DVIPS       = dvips -D 300 $(QUIETPS) -o $@     # tricky
38 TEXINPUTDIR = $(RL_LIBDIR)/doc
39
40 MKDIRS      = ${topdir}/support/mkdirs
41
42 # This should be a program that converts troff to an ascii-readable format
43 NROFF       = groff -Tascii
44
45 # This should be a program that converts troff to postscript
46 GROFF       = groff
47
48 HSUSER      = $(RL_LIBDIR)/doc/hsuser.texinfo
49 RLUSER      = $(RL_LIBDIR)/doc/rluser.texinfo
50
51 .SUFFIXES:      .0 .1 .3 .ms .ps .txt .dvi .html
52
53 .1.ps:
54         $(RM) $@
55         -${GROFF} -man $< > $@
56
57 .1.0:
58         $(RM) $@
59         -${NROFF} -man $< > $@
60
61 .1.html:
62         $(RM) $@
63         -${MAN2HTML} $< | ${HTMLPOST} > $@
64
65 .ms.ps:
66         $(RM) $@
67         -${GROFF} -ms $< > $@
68
69 .ms.txt:
70         $(RM) $@
71         -${NROFF} -ms $< > $@
72
73 .3.ps:
74         $(RM) $@
75         -${GROFF} -man $< > $@
76
77 .3.0:
78         $(RM) $@
79         -${NROFF} -man $< > $@
80
81 .3.html:
82         $(RM) $@
83         -${MAN2HTML} $< > $@
84
85 all: ps info dvi text html
86 nodvi: ps info text html
87
88 PSFILES = bash.ps bashbug.ps readline.ps article.ps builtins.ps
89 DVIFILES = bashref.dvi bashref.ps
90 INFOFILES = bashref.info
91 MAN0FILES = bash.0 bashbug.0 builtins.0 readline.0
92 HTMLFILES = bashref.html bash.html
93
94 ps: ${PSFILES}
95 dvi: ${DVIFILES}
96 info: ${INFOFILES}
97 text: ${MAN0FILES}
98 html: ${HTMLFILES}
99
100 bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
101         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/bashref.texi
102
103 bashref.ps: bashref.dvi
104         $(RM) $@
105         $(DVIPS) bashref.dvi
106
107 bashref.info: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
108         $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
109
110 bashref.html: bashref.texi $(HSUSER) $(RLUSER)
111         $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
112
113 bash.dvi: bash.texinfo $(HSUSER) $(RLUSER)
114         TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) bash.texinfo
115
116 bashman.ps: bash.dvi
117         $(RM) $@
118         $(DVIPS) bash.dvi
119
120 bash.txt: bash.1
121 bash.ps: bash.1
122 bash.html: bash.1 $(MAN2HTML)
123 bashbug.ps: bashbug.1
124 builtins.ps: builtins.1 bash.1
125 bash.0: bash.1
126 bashbug.0: bashbug.1
127 builtins.0: builtins.1 bash.1
128 readline.0: readline.3
129 readline.ps: readline.3
130 article.ps: article.ms
131
132 $(MAN2HTML):    ${topdir}/support/man2html.c
133         -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html)
134
135 CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
136
137 faq:    ${CREATED_FAQ}
138
139 faq.version:    FAQ.version FAQ
140         sh mkfaqvers FAQ.version > $@
141
142 faq.news: FAQ FAQ.headers.news faq.version
143         $(RM) $@
144         cat FAQ.headers.news faq.version FAQ > $@
145
146 faq.news2: FAQ FAQ.headers.news2 faq.version
147         $(RM) $@
148         cat FAQ.headers.news2 faq.version FAQ > $@
149
150 faq.mail: FAQ FAQ.headers.mail faq.version
151         $(RM) $@
152         cat FAQ.headers.mail faq.version FAQ > $@
153
154 clean:
155         $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
156                 *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o
157         ${RM} core *.core
158
159 distclean mostlyclean: clean
160         $(RM) Makefile
161
162 maintainer-clean:       clean
163         ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
164         ${RM} ${CREATED_FAQ}
165         $(RM) Makefile
166
167 installdirs:
168         -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(man1dir)
169 # uncomment the next line to create the directory for the readline man page
170 #       -test -d $(man3dir) || $(SHELL) ${MKDIRS} $(man3dir)
171         -test -d $(infodir) || $(SHELL) ${MKDIRS} $(infodir)
172         
173 install: info installdirs
174         -$(INSTALL_DATA) $(srcdir)/bash.1 $(man1dir)/bash.${man1ext}
175         -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(man1dir)/bashbug.${man1ext}
176 # uncomment the next line to install the readline man page
177 #       -$(INSTALL_DATA) $(srcdir)/readline.3 $(man3dir)/readline.${man3ext}
178 # uncomment the next line to install the builtins man page
179 #       $(INSTALL_DATA) $(srcdir)/builtins.1 $(man1dir)/bash_builtins.${man1ext}
180         -$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info
181 # run install-info if it is present to update the info directory
182         if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
183                 install-info --dir-file=$(infodir)/dir $(infodir)/bash.info; \
184         else true; fi
185
186 uninstall:
187         -$(RM) $(man1dir)/bash.${man1ext} $(man1dir)/bashbug.${man1ext}
188         -$(RM) $(man3dir)/readline.${man3ext}
189         $(RM) $(infodir)/bash.info
190
191 # for use by chet
192 inst:   bashref.texi
193         $(SHELL) ./mkinstall
194         cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL
195         $(RM) INSTALL
196
197 posix:  bashref.texi
198         $(SHELL) ./mkposix
199         cmp -s POSIX.NOTES ../CWRU/POSIX.NOTES || mv POSIX.NOTES ../CWRU/POSIX.NOTES
200         $(RM) POSIX.NOTES