1# $Id: bsd.info.mk,v 1.34 1997/03/12 07:14:44 peter Exp $ 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# <bsd.info.mk> includes the files <bsd.dep.mk> and <bsd.obj.mk>. 7# 8# 9# +++ variables +++ 10# 11# CLEANFILES Additional files to remove for the clean and cleandir targets. 12# 13# DESTDIR Change the tree where the info files gets installed. [not set] 14# 15# DISTRIBUTION Name of distribution. [info] 16# 17# ICOMPRESS_CMD Program to compress info files. Output is to 18# stdout. [${COMPRESS_CMD}] 19# 20# INFO ??? 21# 22# INFODIR Base path for GNU's hypertext system 23# called Info (see info(1)). [${SHAREDIR}/info] 24# 25# INFODIRFILE Top level node/index for info files. [dir] 26# 27# INFOGRP Info group. [${SHAREGRP}] 28# 29# INFOMODE Info mode. [${NOBINMODE}] 30# 31# INFOOWN Info owner. [${SHAREOWN}] 32# 33# INFOSECTION ??? [Miscellaneous] 34# 35# INFOTMPL ??? [${INFODIR}/dir-tmpl] 36# 37# INSTALLINFO ??? [install-info] 38# 39# INSTALLINFODIRS ??? 40# 41# MAKEINFO A program for converting GNU Texinfo files into Info 42# file. [makeinfo] 43# 44# MAKEINFOFLAGS Options for ${MAKEINFO} command. [--no-split] 45# 46# NOINFO Do not make or install info files. [not set] 47# 48# NOINFOCOMPRESS If you do not want info files be 49# compressed when they are installed. [not set] 50# 51# 52# +++ targets +++ 53# 54# clean: 55# remove *.info* Errs errs mklog ${CLEANFILES} 56# 57# depend: 58# Dummy target, do nothing. 59# 60# distribute: 61# This is a variant of install, which will 62# put the stuff into the right "distribution". 63# 64# install: 65# Install the info files. 66# 67# maninstall: 68# Dummy target, do nothing. 69# 70# 71# bsd.obj.mk: cleandir and obj 72 73MAKEINFO?= makeinfo 74MAKEINFOFLAGS+= --no-split # simplify some things, e.g., compression 75SRCDIR?= ${.CURDIR} 76INFODIRFILE?= dir 77INFOTMPL?= ${INFODIR}/dir-tmpl 78INSTALLINFO?= install-info 79INFOSECTION?= Miscellaneous 80ICOMPRESS_CMD?= ${COMPRESS_CMD} 81ICOMPRESS_EXT?= ${COMPRESS_EXT} 82 83.MAIN: all 84 85.SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo 86 87.texi.info: 88 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \ 89 -o ${.TARGET}.new 90 mv -f ${.TARGET}.new ${.TARGET} 91 92.texinfo.info: 93 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \ 94 -o ${.TARGET}.new 95 mv -f ${.TARGET}.new ${.TARGET} 96 97.PATH: ${.CURDIR} ${SRCDIR} 98 99IFILENS= ${INFO:S/$/.info/g} 100 101.if !defined(NOINFO) 102.if !defined(NOINFOCOMPRESS) 103IFILES= ${INFO:S/$/.info${ICOMPRESS_EXT}/g} 104all: ${IFILES} _SUBDIR 105.else 106IFILES= ${IFILENS} 107all: ${IFILES} _SUBDIR 108.endif 109.else 110all: 111.endif 112 113.for x in ${INFO:S/$/.info/g} 114${x:S/$/${ICOMPRESS_EXT}/}: ${x} 115 ${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET} 116.endfor 117 118# What to do if there's no dir file there. This is really gross!!! 119${DESTDIR}${INFODIR}/${INFODIRFILE}: 120 @(cd /usr/src/share/info; make install) 121 122.for x in ${INFO} 123INSTALLINFODIRS+= ${x:S/$/-install/} 124${x:S/$/-install/}: ${DESTDIR}${INFODIR}/${INFODIRFILE} 125 ${INSTALLINFO} --defsection=${INFOSECTION} \ 126 --defentry=${INFOENTRY_${x}} \ 127 ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE} 128.endfor 129 130.PHONY: ${INSTALLINFODIRS} 131 132# The default is "info" and it can never be "bin" 133DISTRIBUTION?= info 134.if ${DISTRIBUTION} == "bin" 135DISTRIBUTION= info 136.endif 137 138.if !target(distribute) 139distribute: _SUBDIR 140 cd ${.CURDIR} ; \ 141 $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies 142.endif 143 144.if defined(SRCS) 145${INFO}.info: ${SRCS} 146 ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} \ 147 ${SRCS:S/^/${SRCDIR}\//g} -o ${INFO}.info.new 148 mv -f ${INFO}.info.new ${INFO}.info 149.endif 150 151depend: _SUBDIR 152 @echo -n 153 154clean: _SUBDIR 155 rm -f ${INFO:S/$/.info*/g} Errs errs mklog ${CLEANFILES} 156 157.if !defined(NOINFO) && defined(INFO) 158install: ${INSTALLINFODIRS} _SUBDIR 159 ${INSTALL} ${COPY} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \ 160 ${IFILES} ${DESTDIR}${INFODIR} 161.else 162install: 163.endif 164 165.if !target(maninstall) 166maninstall: _SUBDIR 167.endif 168 169.include <bsd.dep.mk> 170.include <bsd.obj.mk> 171