summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.links.mk
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-07-02 12:16:54 +0000
committerru <ru@FreeBSD.org>2002-07-02 12:16:54 +0000
commit038386078dfe384615c466ae7a32b271e5e0751f (patch)
treea911f9ed369d3aa9f4facaa8496e2974ad7bcfc6 /share/mk/bsd.links.mk
parent8530756499f8c558b6ab7577e18e02d8aaad8a08 (diff)
downloadFreeBSD-src-038386078dfe384615c466ae7a32b271e5e0751f.zip
FreeBSD-src-038386078dfe384615c466ae7a32b271e5e0751f.tar.gz
Handle installation of hard and symbolic links via a seperate .mk file.
Diffstat (limited to 'share/mk/bsd.links.mk')
-rw-r--r--share/mk/bsd.links.mk30
1 files changed, 30 insertions, 0 deletions
diff --git a/share/mk/bsd.links.mk b/share/mk/bsd.links.mk
new file mode 100644
index 0000000..a1e84ea
--- /dev/null
+++ b/share/mk/bsd.links.mk
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+.if !target(__<bsd.init.mk>__)
+.error bsd.links.mk cannot be included directly.
+.endif
+
+afterinstall: _installlinks
+_installlinks:
+.if defined(LINKS) && !empty(LINKS)
+ @set ${LINKS}; \
+ while test $$# -ge 2; do \
+ l=${DESTDIR}$$1; \
+ shift; \
+ t=${DESTDIR}$$1; \
+ shift; \
+ ${ECHO} $$t -\> $$l; \
+ ln -f $$l $$t; \
+ done; true
+.endif
+.if defined(SYMLINKS) && !empty(SYMLINKS)
+ @set ${SYMLINKS}; \
+ while test $$# -ge 2; do \
+ l=$$1; \
+ shift; \
+ t=${DESTDIR}$$1; \
+ shift; \
+ ${ECHO} $$t -\> $$l; \
+ ln -fs $$l $$t; \
+ done; true
+.endif
OpenPOWER on IntegriCloud