1999-08-21 04:41:41 +04:00
|
|
|
# $NetBSD: bsd.obj.mk,v 1.21 1999/08/21 00:41:41 sommerfeld Exp $
|
1999-02-12 07:13:26 +03:00
|
|
|
|
|
|
|
.if !target(__initialized_obj__)
|
|
|
|
__initialized_obj__:
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
.endif
|
1993-08-15 23:26:05 +04:00
|
|
|
|
1999-02-12 04:10:06 +03:00
|
|
|
.if ${MKOBJ} == "no"
|
1993-08-15 23:26:05 +04:00
|
|
|
obj:
|
|
|
|
.else
|
1993-10-23 05:32:55 +03:00
|
|
|
|
1999-08-21 04:41:41 +04:00
|
|
|
.if defined(MAKEOBJDIR)
|
|
|
|
__objdir= ${MAKEOBJDIR}
|
|
|
|
.elif defined(OBJMACHINE)
|
1993-10-23 05:32:55 +03:00
|
|
|
__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
|
|
|
|
|
1999-06-11 00:48:28 +04:00
|
|
|
PAWD?= /bin/pwd
|
1999-06-08 22:28:38 +04:00
|
|
|
|
1997-05-07 21:06:16 +04:00
|
|
|
obj:
|
1993-10-23 05:32:55 +03:00
|
|
|
@cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
|
1999-06-11 00:48:28 +04:00
|
|
|
here=`${PAWD}`; subdir=$${here#${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
|
1998-08-27 20:54:59 +04:00
|
|
|
|
1998-08-28 00:33:45 +04:00
|
|
|
print-objdir:
|
1998-08-27 20:54:59 +04:00
|
|
|
@echo ${.OBJDIR}
|