1# $FreeBSD: head/share/mk/bsd.info.mk 301284 2016-06-03 19:25:36Z bdrewery $
2#
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.
6#
7#
8# +++ variables +++
9#
--- 71 unchanged lines hidden (view full) ---
81FORMATS?= info
82INFO2HTML?= info2html
83TEX?= tex
84DVIPS?= dvips
85DVIPS2ASCII?= dvips2ascii
86
87.SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html
88
89.texi.info .texinfo.info:
90 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \
91 -o ${.TARGET}
92
93.texi.dvi .texinfo.dvi:
94 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
95 ${TEX} ${.IMPSRC} </dev/null
96# Run again to resolve cross references.
97 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
98 ${TEX} ${.IMPSRC} </dev/null
99
100.texinfo.latin1 .texi.latin1:
101 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
102 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
103 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
104# Run again to resolve cross references.
105 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
106 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
107 ${DVIPS} -o /dev/stdout ${.IMPSRC:T:R}-la.dvi | \
108 ${DVIPS2ASCII} > ${.TARGET}.new
109 mv -f ${.TARGET}.new ${.TARGET}
110
111.dvi.ps:
112 ${DVIPS} -o ${.TARGET} ${.IMPSRC}
113
114.info.html:
115 ${INFO2HTML} ${.IMPSRC}
116 ${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET}
117
118.PATH: ${.CURDIR} ${SRCDIR}
119
120.for _f in ${FORMATS}
121IFILENS+= ${INFO:S/$/.${_f}/}
122.endfor
--- 5 unchanged lines hidden (view full) ---
128.else
129IFILES= ${IFILENS}
130.endif
131.if !defined(_SKIP_BUILD)
132all: ${IFILES}
133.endif
134
135.for x in ${IFILENS}
136${x:S/$/${ICOMPRESS_EXT}/}: ${x}
137 ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
138.endfor
139
140.for x in ${INFO}
141INSTALLINFODIRS+= ${x:S/$/-install/}
142${x:S/$/-install/}:
143.if !empty(.MAKEFLAGS:M-j)
144 lockf -k ${DESTDIR}${INFODIR}/${INFODIRFILE} \
--- 8 unchanged lines hidden (view full) ---
153 ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}
154.endif
155.endfor
156
157.PHONY: ${INSTALLINFODIRS}
158
159.if defined(SRCS)
160CLEANFILES+= ${INFO}.texi
161${INFO}.texi: ${SRCS}
162 cat ${.ALLSRC} > ${.TARGET}
163.endif
164
165# tex garbage
166.if !empty(FORMATS:Mps) || !empty(FORMATS:Mdvi) || !empty(FORMATS:Mlatin1)
167.for _f in aux cp fn ky log out pg toc tp vr dvi
168CLEANFILES+= ${INFO:S/$/.${_f}/} ${INFO:S/$/-la.${_f}/}
169.endfor
--- 27 unchanged lines hidden ---
2#
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.
6#
7#
8# +++ variables +++
9#
--- 71 unchanged lines hidden (view full) ---
81FORMATS?= info
82INFO2HTML?= info2html
83TEX?= tex
84DVIPS?= dvips
85DVIPS2ASCII?= dvips2ascii
86
87.SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html
88
89.texi.info .texinfo.info:
90 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \
91 -o ${.TARGET}
92
93.texi.dvi .texinfo.dvi:
94 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
95 ${TEX} ${.IMPSRC} </dev/null
96# Run again to resolve cross references.
97 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
98 ${TEX} ${.IMPSRC} </dev/null
99
100.texinfo.latin1 .texi.latin1:
101 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
102 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
103 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
104# Run again to resolve cross references.
105 TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
106 ${TEX} ${.IMPSRC:T:R}-la.texi </dev/null
107 ${DVIPS} -o /dev/stdout ${.IMPSRC:T:R}-la.dvi | \
108 ${DVIPS2ASCII} > ${.TARGET}.new
109 mv -f ${.TARGET}.new ${.TARGET}
110
111.dvi.ps:
112 ${DVIPS} -o ${.TARGET} ${.IMPSRC}
113
114.info.html:
115 ${INFO2HTML} ${.IMPSRC}
116 ${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET}
117
118.PATH: ${.CURDIR} ${SRCDIR}
119
120.for _f in ${FORMATS}
121IFILENS+= ${INFO:S/$/.${_f}/}
122.endfor
--- 5 unchanged lines hidden (view full) ---
128.else
129IFILES= ${IFILENS}
130.endif
131.if !defined(_SKIP_BUILD)
132all: ${IFILES}
133.endif
134
135.for x in ${IFILENS}
136${x:S/$/${ICOMPRESS_EXT}/}: ${x}
137 ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
138.endfor
139
140.for x in ${INFO}
141INSTALLINFODIRS+= ${x:S/$/-install/}
142${x:S/$/-install/}:
143.if !empty(.MAKEFLAGS:M-j)
144 lockf -k ${DESTDIR}${INFODIR}/${INFODIRFILE} \
--- 8 unchanged lines hidden (view full) ---
153 ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE}
154.endif
155.endfor
156
157.PHONY: ${INSTALLINFODIRS}
158
159.if defined(SRCS)
160CLEANFILES+= ${INFO}.texi
161${INFO}.texi: ${SRCS}
162 cat ${.ALLSRC} > ${.TARGET}
163.endif
164
165# tex garbage
166.if !empty(FORMATS:Mps) || !empty(FORMATS:Mdvi) || !empty(FORMATS:Mlatin1)
167.for _f in aux cp fn ky log out pg toc tp vr dvi
168CLEANFILES+= ${INFO:S/$/.${_f}/} ${INFO:S/$/-la.${_f}/}
169.endfor
--- 27 unchanged lines hidden ---