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