2003-07-20 18:49:44 +04:00
|
|
|
# $NetBSD: bsd.links.mk,v 1.22 2003/07/20 14:49:44 lukem Exp $
|
1997-05-07 00:54:31 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
1997-05-07 00:54:31 +04:00
|
|
|
.PHONY: linksinstall
|
2002-03-21 15:59:56 +03:00
|
|
|
install: linksinstall
|
1997-03-25 00:54:12 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Default values
|
|
|
|
LINKS?=
|
|
|
|
SYMLINKS?=
|
|
|
|
|
|
|
|
##### Install rules
|
2002-04-30 18:29:01 +04:00
|
|
|
linksinstall:: realinstall
|
2001-11-02 08:21:47 +03:00
|
|
|
.if !empty(SYMLINKS)
|
2000-02-10 21:18:01 +03:00
|
|
|
@(set ${SYMLINKS}; \
|
1997-03-25 00:54:12 +03:00
|
|
|
while test $$# -ge 2; do \
|
2001-11-02 08:21:47 +03:00
|
|
|
l=$$1; shift; \
|
|
|
|
t=${DESTDIR}$$1; shift; \
|
2003-07-20 18:49:44 +04:00
|
|
|
if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
|
|
|
|
[ "$$l" = "$$ttarg" ]; then \
|
|
|
|
continue ; \
|
|
|
|
fi ; \
|
2000-04-23 11:58:17 +04:00
|
|
|
echo "$$t -> $$l"; \
|
2002-10-22 22:48:27 +04:00
|
|
|
${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
|
2000-04-23 11:58:17 +04:00
|
|
|
done; )
|
1997-03-25 00:54:12 +03:00
|
|
|
.endif
|
2001-11-02 08:21:47 +03:00
|
|
|
.if !empty(LINKS)
|
2000-02-10 21:18:01 +03:00
|
|
|
@(set ${LINKS}; \
|
1997-03-25 00:54:12 +03:00
|
|
|
while test $$# -ge 2; do \
|
2001-11-02 08:21:47 +03:00
|
|
|
l=${DESTDIR}$$1; shift; \
|
|
|
|
t=${DESTDIR}$$1; shift; \
|
2003-07-20 18:49:44 +04:00
|
|
|
if ldevino=`${TOOL_STAT} -qf '%d %i' $$l` && \
|
|
|
|
tdevino=`${TOOL_STAT} -qf '%d %i' $$t` && \
|
|
|
|
[ "$$ldevino" = "$$tdevino" ]; then \
|
|
|
|
continue ; \
|
|
|
|
fi ; \
|
|
|
|
echo "$$t -> $$l"; \
|
|
|
|
${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
|
|
|
|
done ; )
|
1997-03-25 00:54:12 +03:00
|
|
|
.endif
|