1 # $FreeBSD: src/share/mk/bsd.info.mk,v 1.57.2.7 2003/05/21 13:00:46 ru Exp $
3 # The include file <bsd.info.mk> handles installing GNU (tech)info files.
4 # Texinfo is a documentation system that uses a single source
5 # file to produce both on-line information and printed output.
10 # CLEANFILES Additional files to remove for the clean and cleandir targets.
12 # DESTDIR Change the tree where the info files gets installed. [not set]
14 # DVIPS A program which convert a TeX DVI file to PostScript [dvips]
16 # DVIPS2ASCII A program to convert a PostScript file which was prior
17 # converted from a TeX DVI file to ascii/latin1 [dvips2ascii]
19 # FORMATS Indicates which output formats will be generated
20 # (info, dvi, latin1, ps, html). [info]
22 # ICOMPRESS_CMD Program to compress info files. Output is to
23 # stdout. [${COMPRESS_CMD}]
25 # INFO texinfo files, without suffix. [set in Makefile]
27 # INFO2HTML A program for converting GNU info files into HTML files
30 # INFODIR Base path for GNU's hypertext system
31 # called Info (see info(1)). [${SHAREDIR}/info]
33 # INFODIRFILE Top level node/index for info files. [dir]
35 # INFOGRP Info group. [${SHAREGRP}]
37 # INFOMODE Info mode. [${NOBINMODE}]
39 # INFOOWN Info owner. [${SHAREOWN}]
41 # INFOSECTION Default section (if one could not be found in
42 # the Info file). [Miscellaneous]
44 # INSTALLINFO A program for installing directory entries from Info
45 # file in the ${INFODIR}/${INFODIRFILE}. [install-info]
47 # INSTALLINFOFLAGS Options for ${INSTALLINFO} command. [--quiet]
51 # MAKEINFO A program for converting GNU Texinfo files into Info
54 # MAKEINFOFLAGS Options for ${MAKEINFO} command. [--no-split]
56 # NOINFO Do not make or install info files. [not set]
58 # NOINFOCOMPRESS If you do not want info files be
59 # compressed when they are installed. [not set]
61 # TEX A program for converting tex files into dvi files [tex]
67 # Install the info files.
70 # bsd.obj.mk: cleandir and obj
72 .include <bsd.init.mk>
75 MAKEINFOFLAGS+= --no-split # simplify some things, e.g., compression
78 INSTALLINFO?= install-info
79 INSTALLINFOFLAGS+=--quiet
80 INFOSECTION?= Miscellaneous
81 ICOMPRESS_CMD?= ${COMPRESS_CMD}
82 ICOMPRESS_EXT?= ${COMPRESS_EXT}
87 DVIPS2ASCII?= dvips2ascii
89 .SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html
91 .texi.info .texinfo.info:
92 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \
95 .texi.dvi .texinfo.dvi:
96 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
97 ${TEX} ${.IMPSRC} </dev/null
98 # Run again to resolve cross references.
99 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
100 ${TEX} ${.IMPSRC} </dev/null
102 .texinfo.latin1 .texi.latin1:
103 perl -npe 's/(^\s*\\input\s+texinfo\s+)/$$1\n@tex\n\\global\\hsize=120mm\n@end tex\n\n/' ${.IMPSRC} >> ${.IMPSRC:T:R}-la.texi
104 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
105 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
106 # Run again to resolve cross references.
107 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
108 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
109 ${DVIPS} -o /dev/stdout ${.IMPSRC:T:R}-la.dvi | \
110 ${DVIPS2ASCII} > ${.TARGET}.new
111 mv -f ${.TARGET}.new ${.TARGET}
114 ${DVIPS} -o ${.TARGET} ${.IMPSRC}
117 ${INFO2HTML} ${.IMPSRC}
118 ln -f ${.TARGET:R}.info.Top.html ${.TARGET}
120 .PATH: ${.CURDIR} ${SRCDIR}
122 .for _f in ${FORMATS}
123 IFILENS+= ${INFO:S/$/.${_f}/}
127 CLEANFILES+= ${IFILENS}
128 .if !defined(NOINFOCOMPRESS)
129 CLEANFILES+= ${IFILENS:S/$/${ICOMPRESS_EXT}/}
130 IFILES= ${IFILENS:S/$/${ICOMPRESS_EXT}/:S/.html${ICOMPRESS_EXT}/.html/}
141 ${x:S/$/${ICOMPRESS_EXT}/}: ${x}
142 ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
146 INSTALLINFODIRS+= ${x:S/$/-install/}
148 ${INSTALLINFO} ${INSTALLINFOFLAGS} \
149 --defsection=${INFOSECTION} \
150 --defentry=${INFOENTRY_${x}} \
151 ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}
154 .PHONY: ${INSTALLINFODIRS}
157 CLEANFILES+= ${INFO}.texi
158 ${INFO}.texi: ${SRCS}
159 cat ${.ALLSRC} > ${.TARGET}
163 .if ${FORMATS:Mps} || ${FORMATS:Mdvi} || ${FORMATS:Mlatin1}
164 .for _f in aux cp fn ky log out pg toc tp vr dvi
165 CLEANFILES+= ${INFO:S/$/.${_f}/} ${INFO:S/$/-la.${_f}/}
167 CLEANFILES+= ${INFO:S/$/-la.texi/}
171 CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/}
174 .if !defined(NOINFO) && defined(INFO)
175 install: ${INSTALLINFODIRS}
176 .if ${IFILES:N*.html}
177 ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
178 ${IFILES:N*.html} ${DESTDIR}${INFODIR}
181 ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
182 ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR}
185 # The indirection in the following is to avoid the null install rule
186 # "install:" from being overridden by the implicit .sh rule if there
187 # happens to be a source file named install.sh. This assumes that there
188 # is no source file named __null_install.sh.
189 install: __null_install
193 .include <bsd.obj.mk>