Fixed make objlink' (and make obj' in the (non-default) OBJLINK case).

Running them twice usually destroyed the target binary.  E.g., the
second `make objlink' in `make objlink; make; make objlink' replaced
the `cat' binary by a symlink cat@ -> /usr/obj/usr/src/bin/cat.

`ln -fs' is unusable when the target might be a symlink that resolves
to a directory.  Then -f applies to a file in the directory and not
to the symlink.  This seems to be the standard (and sometimes useful)
behaviour.
This commit is contained in:
bde 1996-09-05 17:53:13 +00:00
parent 218243765f
commit 1b37717e18

View File

@ -1,4 +1,4 @@
# $Id: bsd.obj.mk,v 1.6 1996/07/12 06:01:55 pst Exp $
# $Id: bsd.obj.mk,v 1.7 1996/07/14 11:09:12 peter Exp $
#
# The include file <bsd.obj.mk> handles creating 'obj' directory
# and cleaning up object files, log files etc.
@ -55,7 +55,8 @@ obj: _SUBDIR
${ECHO} "Unable to create ${.TARGETOBJDIR}."; \
exit 1; \
fi; \
ln -fs ${.TARGETOBJDIR} ${.CURDIR}/obj; \
rm -f ${.CURDIR}/obj; \
ln -s ${.TARGETOBJDIR} ${.CURDIR}/obj; \
${ECHO} "${.CURDIR} -> ${.TARGETOBJDIR}"; \
fi
.endif
@ -65,7 +66,8 @@ obj: _SUBDIR
.if !target(objlink)
objlink: _SUBDIR
@if test -d ${.TARGETOBJDIR}; then \
ln -fs ${.TARGETOBJDIR} ${.CURDIR}/obj; \
rm -f ${.CURDIR}/obj; \
ln -s ${.TARGETOBJDIR} ${.CURDIR}/obj; \
else \
echo "No ${.TARGETOBJDIR} to link to - do a make obj."; \
fi