bsd.inc.mk revision 1.24 1 # $NetBSD: bsd.inc.mk,v 1.24 2003/07/18 08:26:07 lukem Exp $
2
3 .include <bsd.init.mk>
4
5 ##### Basic targets
6 .PHONY: incinstall
7 includes: ${INCS} incinstall
8
9 ##### Install rules
10 incinstall:: # ensure existence
11
12 # -c is forced on here, in order to preserve modtimes for "make depend"
13 __incinstall: .USE
14 @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
15 (echo "${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
16 -m ${NONBINMODE} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}" && \
17 ${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
18 -m ${NONBINMODE} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET})
19
20 .for F in ${INCS:O:u}
21 _FDIR:= ${INCSDIR_${F:C,/,_,g}:U${INCSDIR}} # dir override
22 _FNAME:= ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
23 _F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
24
25 .if ${MKUPDATE} == "no"
26 ${_F}! ${F} __incinstall # install rule
27 .else
28 ${_F}: ${F} __incinstall # install rule
29 .endif
30
31 incinstall:: ${_F}
32 .PRECIOUS: ${_F} # keep if install fails
33 .endfor
34
35 .undef _FDIR
36 .undef _FNAME
37 .undef _F
38