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