2006-03-16 21:43:34 +03:00
|
|
|
# $NetBSD: bsd.info.mk,v 1.38 2006/03/16 18:43:34 jwise 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
|
|
|
|
cleandir: cleaninfo
|
|
|
|
realinstall: infoinstall
|
|
|
|
|
|
|
|
##### Default values
|
|
|
|
INFOFLAGS?=
|
1999-02-11 16:25:42 +03:00
|
|
|
|
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:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-07-27 13:27:18 +04:00
|
|
|
${TOOL_MAKEINFO} ${INFOFLAGS} --no-split -o ${.TARGET} ${.IMPSRC}
|
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
|
2004-01-29 04:48:45 +03:00
|
|
|
.PHONY: infoinstall
|
|
|
|
|
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
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_INSTALL}
|
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}} \
|
2006-03-16 21:43:34 +03:00
|
|
|
${.ALLSRC} ${.TARGET}
|
2002-03-01 18:42:10 +03:00
|
|
|
@[ -f ${INFODIRFILE} ] && \
|
|
|
|
while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null; \
|
|
|
|
do sleep 1; done; \
|
2003-07-10 14:33:58 +04:00
|
|
|
${TOOL_INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \
|
|
|
|
${TOOL_INSTALL_INFO} -d ${INFODIRFILE} ${.TARGET}; \
|
2002-03-01 18:42:10 +03:00
|
|
|
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
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${MKUPDATE} == "no"
|
2002-02-12 00:14:58 +03:00
|
|
|
${_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}
|
|
|
|
|
2004-01-29 04:48:45 +03:00
|
|
|
cleaninfo: .PHONY
|
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>
|
2003-07-14 04:50:04 +04:00
|
|
|
.include <bsd.sys.mk>
|
2001-11-02 08:21:47 +03:00
|
|
|
|
|
|
|
${TARGETS}: # ensure existence
|