1995-06-11 00:46:35 +04:00
|
|
|
# $NetBSD: bsd.obj.mk,v 1.7 1995/06/10 20:46:35 mycroft Exp $
|
1993-08-15 23:26:05 +04:00
|
|
|
|
|
|
|
.if !target(obj)
|
|
|
|
.if defined(NOOBJ)
|
|
|
|
obj:
|
|
|
|
.else
|
1993-10-23 05:32:55 +03:00
|
|
|
|
|
|
|
.if defined(OBJMACHINE)
|
|
|
|
__objdir= obj.${MACHINE}
|
|
|
|
.else
|
|
|
|
__objdir= obj
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(USR_OBJMACHINE)
|
1993-11-07 12:45:04 +03:00
|
|
|
__usrobjdir= ${BSDOBJDIR}.${MACHINE}
|
1993-10-23 05:32:55 +03:00
|
|
|
__usrobjdirpf=
|
|
|
|
.else
|
1993-11-07 12:45:04 +03:00
|
|
|
__usrobjdir= ${BSDOBJDIR}
|
1993-10-23 05:32:55 +03:00
|
|
|
.if defined(OBJMACHINE)
|
|
|
|
__usrobjdirpf= .${MACHINE}
|
|
|
|
.else
|
|
|
|
__usrobjdirpf=
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
1994-06-30 09:21:28 +04:00
|
|
|
obj: _SUBDIRUSE
|
1993-10-23 05:32:55 +03:00
|
|
|
@cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
|
1993-11-07 12:45:04 +03:00
|
|
|
here=`pwd`; subdir=`echo $$here | sed 's,^${BSDSRCDIR}/,,'`; \
|
1993-08-15 23:26:05 +04:00
|
|
|
if test $$here != $$subdir ; then \
|
1993-11-07 12:45:04 +03:00
|
|
|
dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
|
1995-06-11 00:46:35 +04:00
|
|
|
echo "$$here/${__objdir} -> $$dest"; \
|
|
|
|
rm -rf ${__objdir}; \
|
|
|
|
ln -s $$dest ${__objdir}; \
|
1993-11-07 12:45:04 +03:00
|
|
|
if test -d ${__usrobjdir} -a ! -d $$dest; then \
|
1993-08-15 23:26:05 +04:00
|
|
|
mkdir -p $$dest; \
|
|
|
|
else \
|
|
|
|
true; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
true ; \
|
1993-10-23 05:32:55 +03:00
|
|
|
dest=$$here/${__objdir} ; \
|
|
|
|
if test ! -d ${__objdir} ; then \
|
1993-08-15 23:26:05 +04:00
|
|
|
echo "making $$dest" ; \
|
|
|
|
mkdir $$dest; \
|
|
|
|
fi ; \
|
|
|
|
fi;
|
|
|
|
.endif
|
|
|
|
.endif
|