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