1 # $FreeBSD: src/share/mk/bsd.info.mk,v 1.57.2.7 2003/05/21 13:00:46 ru Exp $
2 # $DragonFly: src/share/mk/bsd.info.mk,v 1.2 2003/06/17 04:37:02 dillon Exp $
4 # The include file <bsd.info.mk> handles installing GNU (tech)info files.
5 # Texinfo is a documentation system that uses a single source
6 # file to produce both on-line information and printed output.
11 # CLEANFILES Additional files to remove for the clean and cleandir targets.
13 # DESTDIR Change the tree where the info files gets installed. [not set]
15 # DVIPS A program which convert a TeX DVI file to PostScript [dvips]
17 # DVIPS2ASCII A program to convert a PostScript file which was prior
18 # converted from a TeX DVI file to ascii/latin1 [dvips2ascii]
20 # FORMATS Indicates which output formats will be generated
21 # (info, dvi, latin1, ps, html). [info]
23 # ICOMPRESS_CMD Program to compress info files. Output is to
24 # stdout. [${COMPRESS_CMD}]
26 # INFO texinfo files, without suffix. [set in Makefile]
28 # INFO2HTML A program for converting GNU info files into HTML files
31 # INFODIR Base path for GNU's hypertext system
32 # called Info (see info(1)). [${SHAREDIR}/info]
34 # INFODIRFILE Top level node/index for info files. [dir]
36 # INFOGRP Info group. [${SHAREGRP}]
38 # INFOMODE Info mode. [${NOBINMODE}]
40 # INFOOWN Info owner. [${SHAREOWN}]
42 # INFOSECTION Default section (if one could not be found in
43 # the Info file). [Miscellaneous]
45 # INSTALLINFO A program for installing directory entries from Info
46 # file in the ${INFODIR}/${INFODIRFILE}. [install-info]
48 # INSTALLINFOFLAGS Options for ${INSTALLINFO} command. [--quiet]
52 # MAKEINFO A program for converting GNU Texinfo files into Info
55 # MAKEINFOFLAGS Options for ${MAKEINFO} command. [--no-split]
57 # NOINFO Do not make or install info files. [not set]
59 # NOINFOCOMPRESS If you do not want info files be
60 # compressed when they are installed. [not set]
62 # TEX A program for converting tex files into dvi files [tex]
68 # Install the info files.
71 # bsd.obj.mk: cleandir and obj
73 .include <bsd.init.mk>
76 MAKEINFOFLAGS+= --no-split # simplify some things, e.g., compression
79 INSTALLINFO?= install-info
80 INSTALLINFOFLAGS+=--quiet
81 INFOSECTION?= Miscellaneous
82 ICOMPRESS_CMD?= ${COMPRESS_CMD}
83 ICOMPRESS_EXT?= ${COMPRESS_EXT}
88 DVIPS2ASCII?= dvips2ascii
90 .SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html
92 .texi.info .texinfo.info:
93 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \
96 .texi.dvi .texinfo.dvi:
97 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
98 ${TEX} ${.IMPSRC} </dev/null
99 # Run again to resolve cross references.
100 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
101 ${TEX} ${.IMPSRC} </dev/null
103 .texinfo.latin1 .texi.latin1:
104 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
105 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
106 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
107 # Run again to resolve cross references.
108 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
109 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
110 ${DVIPS} -o /dev/stdout ${.IMPSRC:T:R}-la.dvi | \
111 ${DVIPS2ASCII} > ${.TARGET}.new
112 mv -f ${.TARGET}.new ${.TARGET}
115 ${DVIPS} -o ${.TARGET} ${.IMPSRC}
118 ${INFO2HTML} ${.IMPSRC}
119 ln -f ${.TARGET:R}.info.Top.html ${.TARGET}
121 .PATH: ${.CURDIR} ${SRCDIR}
123 .for _f in ${FORMATS}
124 IFILENS+= ${INFO:S/$/.${_f}/}
128 CLEANFILES+= ${IFILENS}
129 .if !defined(NOINFOCOMPRESS)
130 CLEANFILES+= ${IFILENS:S/$/${ICOMPRESS_EXT}/}
131 IFILES= ${IFILENS:S/$/${ICOMPRESS_EXT}/:S/.html${ICOMPRESS_EXT}/.html/}
142 ${x:S/$/${ICOMPRESS_EXT}/}: ${x}
143 ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
147 INSTALLINFODIRS+= ${x:S/$/-install/}
149 ${INSTALLINFO} ${INSTALLINFOFLAGS} \
150 --defsection=${INFOSECTION} \
151 --defentry=${INFOENTRY_${x}} \
152 ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}
155 .PHONY: ${INSTALLINFODIRS}
158 CLEANFILES+= ${INFO}.texi
159 ${INFO}.texi: ${SRCS}
160 cat ${.ALLSRC} > ${.TARGET}
164 .if ${FORMATS:Mps} || ${FORMATS:Mdvi} || ${FORMATS:Mlatin1}
165 .for _f in aux cp fn ky log out pg toc tp vr dvi
166 CLEANFILES+= ${INFO:S/$/.${_f}/} ${INFO:S/$/-la.${_f}/}
168 CLEANFILES+= ${INFO:S/$/-la.texi/}
172 CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/}
175 .if !defined(NOINFO) && defined(INFO)
176 install: ${INSTALLINFODIRS}
177 .if ${IFILES:N*.html}
178 ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
179 ${IFILES:N*.html} ${DESTDIR}${INFODIR}
182 ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
183 ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR}
186 # The indirection in the following is to avoid the null install rule
187 # "install:" from being overridden by the implicit .sh rule if there
188 # happens to be a source file named install.sh. This assumes that there
189 # is no source file named __null_install.sh.
190 install: __null_install
194 .include <bsd.obj.mk>