2003-06-24 13:49:07 +04:00
|
|
|
# $NetBSD: bsd.info.mk,v 1.28 2003/06/24 09:49:07 tron 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
|
|
|
|
2002-03-01 18:42:10 +03:00
|
|
|
INFODIRFILE=${DESTDIR}${INFODIR}/dir
|
|
|
|
|
|
|
|
# serialize access to ${INFODIRFILE}; needed for parallel makes
|
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}} \
|
2002-10-22 22:48:27 +04:00
|
|
|
${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
|
2002-03-01 18:42:10 +03:00
|
|
|
@[ -f ${INFODIRFILE} ] && \
|
|
|
|
while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null; \
|
|
|
|
do sleep 1; done; \
|
|
|
|
${INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \
|
|
|
|
${INSTALL_INFO} -d ${INFODIRFILE} ${.TARGET}; \
|
|
|
|
rm -f ${INFODIRFILE}.lock
|
|
|
|
|
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
|
|
|
|
|
2002-02-12 00:14:58 +03:00
|
|
|
.if !defined(UPDATE)
|
|
|
|
${_F}! ${F} __infoinstall # install rule
|
|
|
|
.if !defined(BUILD) && !make(all) && !make(${F})
|
|
|
|
${_F}! .MADE # no build at install
|
|
|
|
.endif
|
|
|
|
.else
|
2001-11-02 08:21:47 +03:00
|
|
|
${_F}: ${F} __infoinstall # install rule
|
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
|
2002-02-12 00:14:58 +03:00
|
|
|
.endif
|
|
|
|
|
|
|
|
infoinstall:: ${_F}
|
|
|
|
.PRECIOUS: ${_F} # keep if install fails
|
2000-06-08 07:30:58 +04:00
|
|
|
.endfor
|
2001-11-02 08:21:47 +03:00
|
|
|
|
|
|
|
.undef _FDIR
|
|
|
|
.undef _FNAME
|
|
|
|
.undef _F
|
|
|
|
.endif # ${MKINFO} != "no"
|
|
|
|
|
|
|
|
##### Clean rules
|
2003-06-24 13:49:07 +04:00
|
|
|
CLEANFILES+= ${INFOFILES}
|
|
|
|
|
2000-06-08 07:30:58 +04:00
|
|
|
cleaninfo:
|
2003-06-24 13:49:07 +04:00
|
|
|
.if !empty(CLEANFILES)
|
|
|
|
rm -f ${CLEANFILES}
|
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
|