add support to make obj.${MACHINE} dirs, if the user so requests.

note that not all makefiles in the tree will work with them, yet.
This commit is contained in:
cgd 1993-10-23 02:32:55 +00:00
parent 670f052fd7
commit 5104915994
1 changed files with 26 additions and 7 deletions

View File

@ -1,24 +1,43 @@
# $Id: bsd.obj.mk,v 1.2 1993/10/21 05:27:40 cgd Exp $
# $Id: bsd.obj.mk,v 1.3 1993/10/23 02:32:55 cgd Exp $
.if !target(obj)
.if defined(NOOBJ)
obj:
.else
.if defined(OBJMACHINE)
__objdir= obj.${MACHINE}
.else
__objdir= obj
.endif
.if defined(USR_OBJMACHINE)
__usrobjdir= obj.${MACHINE}
__usrobjdirpf=
.else
__usrobjdir= obj
.if defined(OBJMACHINE)
__usrobjdirpf= .${MACHINE}
.else
__usrobjdirpf=
.endif
.endif
obj:
@cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \
@cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \
if test $$here != $$subdir ; then \
dest=/usr/obj/$$subdir ; \
echo "$$here/obj -> $$dest"; ln -s $$dest obj; \
if test -d /usr/obj -a ! -d $$dest; then \
dest=/usr/${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
echo "$$here/${__objdir} -> $$dest"; ln -s $$dest ${__objdir}; \
if test -d /usr/${__usrobjdir} -a ! -d $$dest; then \
mkdir -p $$dest; \
else \
true; \
fi; \
else \
true ; \
dest=$$here/obj ; \
if test ! -d obj ; then \
dest=$$here/${__objdir} ; \
if test ! -d ${__objdir} ; then \
echo "making $$dest" ; \
mkdir $$dest; \
fi ; \