diff options
author | bde <bde@FreeBSD.org> | 1999-03-23 03:06:25 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-03-23 03:06:25 +0000 |
commit | 9c2168a7db110eba1a53fc1ee5abfd924c688984 (patch) | |
tree | 9d514dc5aed0d26619743b28bcefab6e86bbf54c | |
parent | 787e89e027d176b10b17855470618da96b435fd9 (diff) | |
download | FreeBSD-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
-rw-r--r-- | share/mk/bsd.kmod.mk | 21 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 18 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 16 | ||||
-rw-r--r-- | sys/conf/kmod.mk | 21 |
4 files changed, 59 insertions, 17 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 diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index aea0ff2..bb33b55 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $Id: bsd.lib.mk,v 1.84 1999/01/20 21:42:40 jdp Exp $ +# $Id: bsd.lib.mk,v 1.85 1999/01/22 12:41:26 jdp Exp $ # .if !target(__initialized__) @@ -280,7 +280,7 @@ realinstall: beforeinstall ${INSTALLFLAGS} ${SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) - ln ${LN_FLAGS} -sf ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} + ln -sf ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} .endif .endif .if defined(INSTALL_PIC_ARCHIVE) @@ -295,8 +295,18 @@ realinstall: beforeinstall 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 diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index b8b3a7c..bc3947f 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.80 1998/12/06 17:14:37 bde Exp $ +# $Id: bsd.prog.mk,v 1.81 1999/01/22 12:41:27 jdp Exp $ .if !target(__initialized__) __initialized__: @@ -103,8 +103,18 @@ realinstall: beforeinstall 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 diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index c26a207..516c64c 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/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 |