NetBSD/share/mk/bsd.obj.mk

49 lines
975 B
Makefile
Raw Normal View History

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