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.6 2005/07/07 11:49:56 corecode Exp $
4 # The include file <bsd.info.mk> handles installing GNU (tex)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 echo
's/^( *\\input +texinfo *)/\1\' >${.IMPSRC:T:R}-la.sed
105 echo '@
tex\' >>${.IMPSRC
:T
:R
}-la.sed
106 echo
'\\global\\hsize=120mm\' >>${.IMPSRC:T:R}-la.sed
107 echo '@end
tex\' >>${.IMPSRC
:T
:R
}-la.sed
108 echo
'\' >>${.IMPSRC:T:R}-la.sed
109 echo '/' >>${.IMPSRC:T:R}-la.sed
110 sed -Ef ${.IMPSRC:T:R}-la.sed ${.IMPSRC} >>${.IMPSRC:T:R}-la.texi
111 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
112 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
113 # Run again to resolve cross references.
114 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
115 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
116 ${DVIPS} -o /dev/stdout ${.IMPSRC:T:R}-la.dvi | \
117 ${DVIPS2ASCII} > ${.TARGET}.new
118 mv -f ${.TARGET}.new ${.TARGET}
121 ${DVIPS} -o ${.TARGET} ${.IMPSRC}
124 ${INFO2HTML} ${.IMPSRC}
125 ${LN} -f ${.TARGET:R}.info.Top.html ${.TARGET}
127 .PATH: ${.CURDIR} ${SRCDIR}
129 .for _f in ${FORMATS}
130 IFILENS+= ${INFO:S/$/.${_f}/}
134 CLEANFILES+= ${IFILENS}
135 .if !defined(NOINFOCOMPRESS)
136 CLEANFILES+= ${IFILENS:S/$/${ICOMPRESS_EXT}/}
137 IFILES= ${IFILENS:S/$/${ICOMPRESS_EXT}/:S/.html${ICOMPRESS_EXT}/.html/}
148 ${x:S/$/${ICOMPRESS_EXT}/}: ${x}
149 ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
153 INSTALLINFODIRS+= ${x:S/$/-install/}
155 ${INSTALLINFO} ${INSTALLINFOFLAGS} \
156 --defsection=${INFOSECTION} \
157 --defentry=${INFOENTRY_${x}} \
158 ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}
161 .ORDER: ${INFO:S/$/-install/}
162 .PHONY: ${INSTALLINFODIRS}
165 CLEANFILES+= ${INFO}.texi
166 ${INFO}.texi: ${SRCS}
167 cat ${.ALLSRC} > ${.TARGET}
171 .if !empty(FORMATS:Mps) || !empty(FORMATS:Mdvi) || !empty(FORMATS:Mlatin1)
172 .for _f in aux cp fn ky log out pg toc tp vr dvi
173 CLEANFILES+= ${INFO:S/$/.${_f}/} ${INFO:S/$/-la.${_f}/}
175 CLEANFILES+= ${INFO:S/$/-la.texi/} ${INFO:S/$/-la.sed/}
178 .if !empty(FORMATS:Mhtml)
179 CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/}
182 .if !defined(NOINFO) && defined(INFO)
183 install: ${INSTALLINFODIRS}
184 .if !empty(IFILES:N*.html)
185 ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
186 ${IFILES:N*.html} ${DESTDIR}${INFODIR}
188 .if !empty(FORMATS:Mhtml)
189 ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
190 ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR}
193 # The indirection in the following is to avoid the null install rule
194 # "install:" from being overridden by the implicit .sh rule if there
195 # happens to be a source file named install.sh. This assumes that there
196 # is no source file named __null_install.sh.
197 install: __null_install
201 .include <bsd.obj.mk>