2004-06-25 06:05:39 +04:00
|
|
|
# $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
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
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
|
2004-01-29 04:48:45 +03:00
|
|
|
.PHONY: linksinstall
|
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 ; \
|
2003-11-07 03:05:24 +03:00
|
|
|
${_MKSHMSG_INSTALL} $$t; \
|
|
|
|
${_MKSHECHO} ${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
|
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 ; \
|
2003-11-07 03:05:24 +03:00
|
|
|
${_MKSHMSG_INSTALL} $$t; \
|
|
|
|
${_MKSHECHO} ${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
|
2003-07-20 18:49:44 +04:00
|
|
|
${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
|
|
|
|
done ; )
|
1997-03-25 00:54:12 +03:00
|
|
|
.endif
|
2003-07-28 05:00:52 +04:00
|
|
|
|
2004-05-13 17:05:53 +04:00
|
|
|
|
|
|
|
configinstall: configlinksinstall
|
|
|
|
configlinksinstall:: .PHONY
|
2004-05-16 13:44:38 +04:00
|
|
|
.if defined(CONFIGSYMLINKS)
|
2004-05-13 17:05:53 +04:00
|
|
|
@(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
|
2004-06-25 06:05:39 +04:00
|
|
|
.if defined(CONFIGLINKS) && !empty(CONFIGLINKS)
|
2004-05-16 13:44:38 +04:00
|
|
|
@(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
|
2004-05-13 17:05:53 +04:00
|
|
|
|
2003-07-28 05:00:52 +04:00
|
|
|
.include <bsd.sys.mk>
|