summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.kmod.mk
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-03-23 03:06:25 +0000
committerbde <bde@FreeBSD.org>1999-03-23 03:06:25 +0000
commit9c2168a7db110eba1a53fc1ee5abfd924c688984 (patch)
tree9d514dc5aed0d26619743b28bcefab6e86bbf54c /share/mk/bsd.kmod.mk
parent787e89e027d176b10b17855470618da96b435fd9 (diff)
downloadFreeBSD-src-9c2168a7db110eba1a53fc1ee5abfd924c688984.zip
FreeBSD-src-9c2168a7db110eba1a53fc1ee5abfd924c688984.tar.gz
Removed all traces of LN_FLAGS. It was only used to produce a link
/usr/sbin/sysctl -> ${DESTDIR}/sbin/sysctl in some versions of 2.2, and this link was broken if DESTDIR was set. Added a SYMLINKS macro. This works the same as LINKS, except it creates symlinks and the linked-to pathname may be relative. This is more flexible than LN_FLAGS, since it supports installing symlinks independently of hard links. Use `ln -f[s] ...' instead of `rm -f ...; ln [-s] ...' for LINKS and SYMLINKS. This is equivalent if the target is neither a directory nor a symlink to a directory. PR: 8279
Diffstat (limited to 'share/mk/bsd.kmod.mk')
-rw-r--r--share/mk/bsd.kmod.mk21
1 files changed, 16 insertions, 5 deletions
diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk
index c26a207..516c64c 100644
--- a/share/mk/bsd.kmod.mk
+++ b/share/mk/bsd.kmod.mk
@@ -1,5 +1,5 @@
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
-# $Id: bsd.kmod.mk,v 1.57 1998/11/05 04:01:55 peter Exp $
+# $Id: bsd.kmod.mk,v 1.58 1998/11/11 07:40:44 peter Exp $
#
# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
#
@@ -32,8 +32,6 @@
#
# LINKS= /lkm/master /lkm/meister
#
-# LN_FLAGS Flags for ln(1) (see variable LINKS)
-#
# MODLOAD Command to load a kernel module [/sbin/modload]
#
# MODUNLOAD Command to unload a kernel module [/sbin/modunload]
@@ -53,6 +51,9 @@
# Each of the targets will execute the same target in the
# subdirectories.
#
+# SYMLINKS Same as LINKS, except it creates symlinks and the
+# linked-to pathname may be relative.
+#
# DESTDIR, DISTDIR are set by other Makefiles (e.g. bsd.own.mk)
#
#
@@ -279,8 +280,18 @@ realinstall: _SUBDIR
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
- rm -f $$t; \
- ln ${LN_FLAGS} $$l $$t; \
+ 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