2006-03-16 21:43:34 +03:00
|
|
|
# $NetBSD: bsd.inc.mk,v 1.32 2006/03/16 18:43:34 jwise Exp $
|
2003-07-18 12:26:01 +04:00
|
|
|
|
|
|
|
.include <bsd.init.mk>
|
1997-05-07 00:54:31 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
2003-08-03 13:23:14 +04:00
|
|
|
includes: ${INCS} incinstall inclinkinstall
|
|
|
|
|
|
|
|
##### Default values
|
|
|
|
INCSYMLINKS?=
|
1997-03-25 00:54:12 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Install rules
|
|
|
|
incinstall:: # ensure existence
|
2004-01-29 04:48:45 +03:00
|
|
|
.PHONY: incinstall
|
2000-06-06 09:40:47 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
# -c is forced on here, in order to preserve modtimes for "make depend"
|
2000-06-06 13:53:29 +04:00
|
|
|
__incinstall: .USE
|
1997-03-25 00:54:12 +03:00
|
|
|
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
|
2003-11-07 03:05:24 +03:00
|
|
|
(${_MKSHMSG_INSTALL} ${.TARGET}; \
|
2004-01-27 05:52:19 +03:00
|
|
|
${_MKSHECHO} "${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
|
2006-03-16 21:43:34 +03:00
|
|
|
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
|
2004-01-27 05:52:19 +03:00
|
|
|
${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
|
2006-03-16 21:43:34 +03:00
|
|
|
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
|
2000-06-06 13:53:29 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.for F in ${INCS:O:u}
|
|
|
|
_FDIR:= ${INCSDIR_${F:C,/,_,g}:U${INCSDIR}} # dir override
|
|
|
|
_FNAME:= ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
|
|
|
|
_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} __incinstall # install rule
|
|
|
|
.else
|
2001-11-02 08:21:47 +03:00
|
|
|
${_F}: ${F} __incinstall # install rule
|
2002-02-12 00:14:58 +03:00
|
|
|
.endif
|
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
incinstall:: ${_F}
|
|
|
|
.PRECIOUS: ${_F} # keep if install fails
|
1997-03-25 00:54:12 +03:00
|
|
|
.endfor
|
1997-05-07 19:53:28 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.undef _FDIR
|
|
|
|
.undef _FNAME
|
|
|
|
.undef _F
|
2003-08-03 13:23:14 +04:00
|
|
|
|
2004-07-06 16:07:34 +04:00
|
|
|
inclinkinstall: .PHONY
|
2003-08-03 13:23:14 +04:00
|
|
|
.if !empty(INCSYMLINKS)
|
|
|
|
@(set ${INCSYMLINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
l=$$1; shift; \
|
|
|
|
t=${DESTDIR}$$1; shift; \
|
|
|
|
if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
|
|
|
|
[ "$$l" = "$$ttarg" ]; then \
|
|
|
|
continue ; \
|
|
|
|
fi ; \
|
2003-11-07 03:05:24 +03:00
|
|
|
${_MKSHMSG_INSTALL} $$t; \
|
2006-03-16 21:43:34 +03:00
|
|
|
${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
|
|
|
|
${INSTALL_SYMLINK} $$l $$t; \
|
2003-08-03 13:23:14 +04:00
|
|
|
done; )
|
|
|
|
.endif
|