1 1.13 simonb # $NetBSD: bsd.links.mk,v 1.13 2000/04/23 07:58:17 simonb Exp $ 2 1.3 mycroft 3 1.3 mycroft .PHONY: linksinstall 4 1.6 mycroft realinstall: linksinstall 5 1.1 christos 6 1.1 christos .if defined(SYMLINKS) && !empty(SYMLINKS) 7 1.1 christos linksinstall:: 8 1.11 drochner @(set ${SYMLINKS}; \ 9 1.1 christos while test $$# -ge 2; do \ 10 1.1 christos l=$$1; \ 11 1.1 christos shift; \ 12 1.1 christos t=${DESTDIR}$$1; \ 13 1.1 christos shift; \ 14 1.13 simonb if [ -L $$t ]; then \ 15 1.13 simonb cur=`ls -ld $$t | awk '{print $$NF}'` ; \ 16 1.13 simonb if [ "$$cur" = "$$l" ]; then \ 17 1.13 simonb continue ; \ 18 1.13 simonb fi; \ 19 1.13 simonb fi; \ 20 1.13 simonb echo "$$t -> $$l"; \ 21 1.13 simonb rm -rf $$t; ln -s $$l $$t; \ 22 1.13 simonb done; ) 23 1.1 christos .endif 24 1.1 christos .if defined(LINKS) && !empty(LINKS) 25 1.1 christos linksinstall:: 26 1.11 drochner @(set ${LINKS}; \ 27 1.10 mycroft echo ".include <bsd.own.mk>"; \ 28 1.1 christos while test $$# -ge 2; do \ 29 1.1 christos l=${DESTDIR}$$1; \ 30 1.1 christos shift; \ 31 1.1 christos t=${DESTDIR}$$1; \ 32 1.1 christos shift; \ 33 1.11 drochner echo "realall: $$t"; \ 34 1.1 christos echo ".PHONY: $$t"; \ 35 1.7 mycroft echo "$$t:"; \ 36 1.1 christos echo " @echo \"$$t -> $$l\""; \ 37 1.12 mycroft echo " @rm -f $$t; ln $$l $$t"; \ 38 1.11 drochner done; \ 39 1.11 drochner ) | ${MAKE} -f- all 40 1.1 christos .endif 41 1.1 christos 42 1.1 christos .if !target(linksinstall) 43 1.1 christos linksinstall: 44 1.1 christos .endif 45