1 1.32 jwise # $NetBSD: bsd.inc.mk,v 1.32 2006/03/16 18:43:34 jwise Exp $ 2 1.24 lukem 3 1.24 lukem .include <bsd.init.mk> 4 1.3 mycroft 5 1.20 tv ##### Basic targets 6 1.25 lukem includes: ${INCS} incinstall inclinkinstall 7 1.25 lukem 8 1.25 lukem ##### Default values 9 1.25 lukem INCSYMLINKS?= 10 1.1 christos 11 1.20 tv ##### Install rules 12 1.20 tv incinstall:: # ensure existence 13 1.30 lukem .PHONY: incinstall 14 1.14 mycroft 15 1.20 tv # -c is forced on here, in order to preserve modtimes for "make depend" 16 1.16 mycroft __incinstall: .USE 17 1.1 christos @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \ 18 1.28 lukem (${_MKSHMSG_INSTALL} ${.TARGET}; \ 19 1.29 lukem ${_MKSHECHO} "${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \ 20 1.32 jwise -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \ 21 1.29 lukem ${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \ 22 1.32 jwise -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}) 23 1.16 mycroft 24 1.20 tv .for F in ${INCS:O:u} 25 1.20 tv _FDIR:= ${INCSDIR_${F:C,/,_,g}:U${INCSDIR}} # dir override 26 1.20 tv _FNAME:= ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override 27 1.20 tv _F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path 28 1.20 tv 29 1.24 lukem .if ${MKUPDATE} == "no" 30 1.22 mycroft ${_F}! ${F} __incinstall # install rule 31 1.22 mycroft .else 32 1.20 tv ${_F}: ${F} __incinstall # install rule 33 1.22 mycroft .endif 34 1.22 mycroft 35 1.20 tv incinstall:: ${_F} 36 1.20 tv .PRECIOUS: ${_F} # keep if install fails 37 1.1 christos .endfor 38 1.5 mycroft 39 1.20 tv .undef _FDIR 40 1.20 tv .undef _FNAME 41 1.20 tv .undef _F 42 1.25 lukem 43 1.31 mycroft inclinkinstall: .PHONY 44 1.25 lukem .if !empty(INCSYMLINKS) 45 1.25 lukem @(set ${INCSYMLINKS}; \ 46 1.25 lukem while test $$# -ge 2; do \ 47 1.25 lukem l=$$1; shift; \ 48 1.25 lukem t=${DESTDIR}$$1; shift; \ 49 1.25 lukem if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \ 50 1.25 lukem [ "$$l" = "$$ttarg" ]; then \ 51 1.25 lukem continue ; \ 52 1.25 lukem fi ; \ 53 1.28 lukem ${_MKSHMSG_INSTALL} $$t; \ 54 1.32 jwise ${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \ 55 1.32 jwise ${INSTALL_SYMLINK} $$l $$t; \ 56 1.25 lukem done; ) 57 1.25 lukem .endif 58