bsd.links.mk revision 1.24 1 # $NetBSD: bsd.links.mk,v 1.24 2003/07/28 01:00:52 lukem Exp $
2
3 .include <bsd.init.mk>
4
5 ##### Basic targets
6 .PHONY: linksinstall
7 install: linksinstall
8
9 ##### Default values
10 LINKS?=
11 SYMLINKS?=
12
13 ##### Install rules
14 linksinstall:: realinstall
15 .if !empty(SYMLINKS)
16 @(set ${SYMLINKS}; \
17 while test $$# -ge 2; do \
18 l=$$1; shift; \
19 t=${DESTDIR}$$1; shift; \
20 if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
21 [ "$$l" = "$$ttarg" ]; then \
22 continue ; \
23 fi ; \
24 echo "$$t -> $$l"; \
25 ${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
26 done; )
27 .endif
28 .if !empty(LINKS)
29 @(set ${LINKS}; \
30 while test $$# -ge 2; do \
31 l=${DESTDIR}$$1; shift; \
32 t=${DESTDIR}$$1; shift; \
33 if ldevino=`${TOOL_STAT} -qf '%d %i' $$l` && \
34 tdevino=`${TOOL_STAT} -qf '%d %i' $$t` && \
35 [ "$$ldevino" = "$$tdevino" ]; then \
36 continue ; \
37 fi ; \
38 echo "$$t -> $$l"; \
39 ${INSTALL_LINK} ${SYSPKGTAG} $$l $$t; \
40 done ; )
41 .endif
42
43 .include <bsd.sys.mk>
44