2001-11-28 23:19:08 +03:00
|
|
|
# $NetBSD: bsd.info.mk,v 1.24 2001/11/28 20:19:08 tv Exp $
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.include <bsd.init.mk>
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
|
|
|
.PHONY: infoinstall cleaninfo
|
|
|
|
cleandir: cleaninfo
|
|
|
|
realinstall: infoinstall
|
|
|
|
|
|
|
|
##### Default values
|
1999-02-11 16:25:42 +03:00
|
|
|
MAKEINFO?= makeinfo
|
2001-11-02 08:21:47 +03:00
|
|
|
INFOFLAGS?=
|
1999-02-11 16:25:42 +03:00
|
|
|
INSTALL_INFO?= install-info
|
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
INFOFILES?=
|
|
|
|
|
|
|
|
##### Build rules
|
|
|
|
.if ${MKINFO} != "no"
|
|
|
|
|
|
|
|
INFOFILES= ${TEXINFO:C/\.te?xi(nfo)?$/.info/}
|
|
|
|
|
|
|
|
realall: ${INFOFILES}
|
|
|
|
.NOPATH: ${INFOFILES}
|
2000-06-08 07:30:58 +04:00
|
|
|
|
1999-02-11 19:50:46 +03:00
|
|
|
.SUFFIXES: .txi .texi .texinfo .info
|
1999-02-11 16:25:42 +03:00
|
|
|
|
1999-02-11 19:50:46 +03:00
|
|
|
.txi.info .texi.info .texinfo.info:
|
2001-08-02 09:42:56 +04:00
|
|
|
${MAKEINFO} ${INFOFLAGS} --no-split -o $@ $<
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.endif # ${MKINFO} != "no"
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Install rules
|
|
|
|
infoinstall:: # ensure existence
|
2000-06-08 07:30:58 +04:00
|
|
|
.if ${MKINFO} != "no"
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2000-06-08 07:30:58 +04:00
|
|
|
__infoinstall: .USE
|
2001-11-02 08:21:47 +03:00
|
|
|
${INSTALL_FILE} \
|
2000-06-10 18:12:03 +04:00
|
|
|
-o ${INFOOWN_${.ALLSRC:T}:U${INFOOWN}} \
|
|
|
|
-g ${INFOGRP_${.ALLSRC:T}:U${INFOGRP}} \
|
|
|
|
-m ${INFOMODE_${.ALLSRC:T}:U${INFOMODE}} \
|
2000-06-08 07:30:58 +04:00
|
|
|
${.ALLSRC} ${.TARGET}
|
2001-11-02 08:21:47 +03:00
|
|
|
@${INSTALL_INFO} --remove --info-dir=${DESTDIR}${INFODIR} ${.TARGET} 2>/dev/null
|
2000-06-10 18:12:03 +04:00
|
|
|
${INSTALL_INFO} --info-dir=${DESTDIR}${INFODIR} ${.TARGET}
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-05-08 07:19:51 +04:00
|
|
|
.for F in ${INFOFILES:O:u}
|
2001-11-02 08:21:47 +03:00
|
|
|
_FDIR:= ${INFODIR_${F}:U${INFODIR}} # dir overrides
|
|
|
|
_FNAME:= ${INFONAME_${F}:U${INFONAME:U${F:T}}} # name overrides
|
|
|
|
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
|
|
|
|
|
|
|
${_F}: ${F} __infoinstall # install rule
|
|
|
|
infoinstall:: ${_F}
|
|
|
|
.PRECIOUS: ${_F} # keep if install fails
|
2001-11-28 23:19:08 +03:00
|
|
|
.PHONY: ${UPDATE:D:U${_F}} # clobber unless UPDATE
|
2000-06-08 07:30:58 +04:00
|
|
|
.if !defined(BUILD) && !make(all) && !make(${F})
|
2001-11-02 08:21:47 +03:00
|
|
|
${_F}: .MADE # no build at install
|
2000-06-08 07:30:58 +04:00
|
|
|
.endif
|
|
|
|
.endfor
|
2001-11-02 08:21:47 +03:00
|
|
|
|
|
|
|
.undef _FDIR
|
|
|
|
.undef _FNAME
|
|
|
|
.undef _F
|
|
|
|
.endif # ${MKINFO} != "no"
|
|
|
|
|
|
|
|
##### Clean rules
|
2000-06-08 07:30:58 +04:00
|
|
|
cleaninfo:
|
2001-11-02 08:21:47 +03:00
|
|
|
.if !empty(INFOFILES)
|
|
|
|
rm -f ${INFOFILES}
|
2000-06-08 07:30:58 +04:00
|
|
|
.endif
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Pull in related .mk logic
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
|
|
|
|
${TARGETS}: # ensure existence
|