1 1.19 sommerfe # $NetBSD: bsd.links.mk,v 1.19 2002/04/30 14:29:01 sommerfeld Exp $ 2 1.3 mycroft 3 1.15 tv ##### Basic targets 4 1.3 mycroft .PHONY: linksinstall 5 1.18 pk install: linksinstall 6 1.1 christos 7 1.15 tv ##### Default values 8 1.15 tv LINKS?= 9 1.15 tv SYMLINKS?= 10 1.15 tv 11 1.15 tv ##### Install rules 12 1.19 sommerfe linksinstall:: realinstall 13 1.15 tv .if !empty(SYMLINKS) 14 1.11 drochner @(set ${SYMLINKS}; \ 15 1.1 christos while test $$# -ge 2; do \ 16 1.15 tv l=$$1; shift; \ 17 1.15 tv t=${DESTDIR}$$1; shift; \ 18 1.14 cgd if [ -h $$t ]; then \ 19 1.13 simonb cur=`ls -ld $$t | awk '{print $$NF}'` ; \ 20 1.13 simonb if [ "$$cur" = "$$l" ]; then \ 21 1.13 simonb continue ; \ 22 1.13 simonb fi; \ 23 1.13 simonb fi; \ 24 1.13 simonb echo "$$t -> $$l"; \ 25 1.16 perry rm -rf $$t; ${INSTALL_SYMLINK} $$l $$t; \ 26 1.13 simonb done; ) 27 1.1 christos .endif 28 1.15 tv .if !empty(LINKS) 29 1.11 drochner @(set ${LINKS}; \ 30 1.10 mycroft echo ".include <bsd.own.mk>"; \ 31 1.1 christos while test $$# -ge 2; do \ 32 1.15 tv l=${DESTDIR}$$1; shift; \ 33 1.15 tv t=${DESTDIR}$$1; shift; \ 34 1.11 drochner echo "realall: $$t"; \ 35 1.17 mycroft echo "$$t!"; \ 36 1.1 christos echo " @echo \"$$t -> $$l\""; \ 37 1.16 perry echo " @rm -f $$t; ${INSTALL_LINK} $$l $$t"; \ 38 1.11 drochner done; \ 39 1.11 drochner ) | ${MAKE} -f- all 40 1.1 christos .endif 41