NetBSD/share/mk/bsd.obj.mk
cgd 5104915994 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.
1993-10-23 02:32:55 +00:00

47 lines
916 B
Makefile

# $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 ${__objdir} > /dev/null 2>&1 || true; \
here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \
if test $$here != $$subdir ; 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/${__objdir} ; \
if test ! -d ${__objdir} ; then \
echo "making $$dest" ; \
mkdir $$dest; \
fi ; \
fi;
.endif
.endif