NetBSD/share/mk/bsd.links.mk

79 lines
1.9 KiB
Makefile
Raw Normal View History

# $NetBSD: bsd.links.mk,v 1.29 2004/06/25 02:05:39 christos Exp $
2003-07-20 18:53:10 +04:00
.include <bsd.init.mk>
1997-05-07 00:54:31 +04:00
##### Basic targets
install: linksinstall
##### Default values
LINKS?=
SYMLINKS?=
##### Install rules
.PHONY: linksinstall
linksinstall:: realinstall
.if !empty(SYMLINKS)
@(set ${SYMLINKS}; \
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; \
${_MKSHECHO} ${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
done; )
.endif
.if !empty(LINKS)
@(set ${LINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; shift; \
t=${DESTDIR}$$1; shift; \
if ldevino=`${TOOL_STAT} -qf '%d %i' $$l` && \
tdevino=`${TOOL_STAT} -qf '%d %i' $$t` && \
[ "$$ldevino" = "$$tdevino" ]; then \
continue ; \
fi ; \
2003-11-07 03:05:24 +03:00
${_MKSHMSG_INSTALL} $$t; \
${_MKSHECHO} ${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
done ; )
.endif
configinstall: configlinksinstall
configlinksinstall:: .PHONY
.if defined(CONFIGSYMLINKS)
@(set ${CONFIGSYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; shift; \
t=${DESTDIR}$$1; shift; \
if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
[ "$$l" = "$$ttarg" ]; then \
continue ; \
fi ; \
${_MKSHMSG_INSTALL} $$t; \
${_MKSHECHO} ${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
done; )
.endif
.if defined(CONFIGLINKS) && !empty(CONFIGLINKS)
@(set ${CONFIGLINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; shift; \
t=${DESTDIR}$$1; shift; \
if ldevino=`${TOOL_STAT} -qf '%d %i' $$l` && \
tdevino=`${TOOL_STAT} -qf '%d %i' $$t` && \
[ "$$ldevino" = "$$tdevino" ]; then \
continue ; \
fi ; \
${_MKSHMSG_INSTALL} $$t; \
${_MKSHECHO} ${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
done ; )
.endif
.include <bsd.sys.mk>