ramdisk Makefile: CLEANFILES fix
[minix.git] / share / mk / bsd.info.mk
blobef6bd1f6140a40f211c813f4e248defe10e380f7
1 # $NetBSD: bsd.info.mk,v 1.40 2011/09/10 16:57:35 apb Exp $
3 .include <bsd.init.mk>
5 ##### Basic targets
6 realinstall: infoinstall
8 ##### Default values
9 INFOFLAGS?=
11 INFOFILES?=
13 ##### Build rules
14 .if ${MKINFO} != "no"
16 INFOFILES= ${TEXINFO:C/\.te?xi(nfo)?$/.info/}
18 realall: ${INFOFILES}
19 .NOPATH: ${INFOFILES}
21 .SUFFIXES: .txi .texi .texinfo .info
23 .txi.info .texi.info .texinfo.info:
24 ${_MKTARGET_CREATE}
25 ${TOOL_MAKEINFO} ${INFOFLAGS} --no-split --no-version-header -o ${.TARGET} ${.IMPSRC}
27 .endif # ${MKINFO} != "no"
29 ##### Install rules
30 infoinstall:: # ensure existence
31 .PHONY: infoinstall
33 .if ${MKINFO} != "no"
35 INFODIRFILE=${DESTDIR}${INFODIR}/dir
37 # serialize access to ${INFODIRFILE}; needed for parallel makes
38 __infoinstall: .USE
39 ${_MKTARGET_INSTALL}
40 ${INSTALL_FILE} \
41 -o ${INFOOWN_${.ALLSRC:T}:U${INFOOWN}} \
42 -g ${INFOGRP_${.ALLSRC:T}:U${INFOGRP}} \
43 -m ${INFOMODE_${.ALLSRC:T}:U${INFOMODE}} \
44 ${.ALLSRC} ${.TARGET}
45 @[ -f ${INFODIRFILE} ] && \
46 while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null; \
47 do sleep 1; done; \
48 ${TOOL_INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \
49 ${TOOL_INSTALL_INFO} -d ${INFODIRFILE} ${.TARGET}; \
50 rm -f ${INFODIRFILE}.lock
53 .for F in ${INFOFILES:O:u}
54 _FDIR:= ${INFODIR_${F}:U${INFODIR}} # dir overrides
55 _FNAME:= ${INFONAME_${F}:U${INFONAME:U${F:T}}} # name overrides
56 _F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
58 .if ${MKUPDATE} == "no"
59 ${_F}! ${F} __infoinstall # install rule
60 .if !defined(BUILD) && !make(all) && !make(${F})
61 ${_F}! .MADE # no build at install
62 .endif
63 .else
64 ${_F}: ${F} __infoinstall # install rule
65 .if !defined(BUILD) && !make(all) && !make(${F})
66 ${_F}: .MADE # no build at install
67 .endif
68 .endif
70 infoinstall:: ${_F}
71 .PRECIOUS: ${_F} # keep if install fails
72 .endfor
74 .undef _FDIR
75 .undef _FNAME
76 .undef _F
77 .endif # ${MKINFO} != "no"
79 ##### Clean rules
80 CLEANDIRFILES+= ${INFOFILES}
82 ##### Pull in related .mk logic
83 .include <bsd.obj.mk>
84 .include <bsd.sys.mk>
85 .include <bsd.clean.mk>
87 ${TARGETS}: # ensure existence