NetBSD/share/mk/bsd.inc.mk

57 lines
1.4 KiB
Makefile
Raw Normal View History

# $NetBSD: bsd.inc.mk,v 1.27 2003/10/19 03:00:55 lukem Exp $
.include <bsd.init.mk>
1997-05-07 00:54:31 +04:00
##### Basic targets
.PHONY: incinstall
includes: ${INCS} incinstall inclinkinstall
##### Default values
INCSYMLINKS?=
##### Install rules
incinstall:: # ensure existence
# -c is forced on here, in order to preserve modtimes for "make depend"
2000-06-06 13:53:29 +04:00
__incinstall: .USE
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
(${_MKSHMSG} "install ${.TARGET}"; \
${_MKSHECHO} "${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
-m ${NONBINMODE} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}" && \
${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
-m ${NONBINMODE} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET})
2000-06-06 13:53:29 +04: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
.if ${MKUPDATE} == "no"
${_F}! ${F} __incinstall # install rule
.else
${_F}: ${F} __incinstall # install rule
.endif
incinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
1997-05-07 19:53:28 +04:00
.undef _FDIR
.undef _FNAME
.undef _F
inclinkinstall::
.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 ; \
echo "$$t -> $$l"; \
${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
done; )
.endif