diff options
Diffstat (limited to 'bootstrap/bmake/mk/bsd.links.mk')
-rw-r--r-- | bootstrap/bmake/mk/bsd.links.mk | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bootstrap/bmake/mk/bsd.links.mk b/bootstrap/bmake/mk/bsd.links.mk new file mode 100644 index 00000000000..d040eb60de8 --- /dev/null +++ b/bootstrap/bmake/mk/bsd.links.mk @@ -0,0 +1,44 @@ +# $NetBSD: bsd.links.mk,v 1.1.1.1 2004/03/11 13:04:17 grant Exp $ + +.PHONY: linksinstall +realinstall: linksinstall + +.if defined(SYMLINKS) && !empty(SYMLINKS) +linksinstall:: + @(set ${SYMLINKS}; \ + while test $$# -ge 2; do \ + l=$$1; \ + shift; \ + t=${DESTDIR}$$1; \ + shift; \ + if [ -h $$t ]; then \ + cur=`ls -ld $$t | awk '{print $$NF}'` ; \ + if [ "$$cur" = "$$l" ]; then \ + continue ; \ + fi; \ + fi; \ + echo "$$t -> $$l"; \ + rm -rf $$t; ln -s $$l $$t; \ + done; ) +.endif +.if defined(LINKS) && !empty(LINKS) +linksinstall:: + @(set ${LINKS}; \ + echo ".include <bsd.own.mk>"; \ + while test $$# -ge 2; do \ + l=${DESTDIR}$$1; \ + shift; \ + t=${DESTDIR}$$1; \ + shift; \ + echo "realall: $$t"; \ + echo ".PHONY: $$t"; \ + echo "$$t:"; \ + echo " @echo \"$$t -> $$l\""; \ + echo " @rm -f $$t; ln $$l $$t"; \ + done; \ + ) | ${MAKE} -f- all +.endif + +.if !target(linksinstall) +linksinstall: +.endif |