bsd.obj.mk revision 1.3
1#	$Id: bsd.obj.mk,v 1.3 1993/10/23 02:32:55 cgd Exp $
2
3.if !target(obj)
4.if defined(NOOBJ)
5obj:
6.else
7
8.if defined(OBJMACHINE)
9__objdir=	obj.${MACHINE}
10.else
11__objdir=	obj
12.endif
13
14.if defined(USR_OBJMACHINE)
15__usrobjdir=	obj.${MACHINE}
16__usrobjdirpf=	
17.else
18__usrobjdir=	obj
19.if defined(OBJMACHINE)
20__usrobjdirpf=	.${MACHINE}
21.else
22__usrobjdirpf=
23.endif
24.endif
25
26obj:
27	@cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
28	here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \
29	if test $$here != $$subdir ; then \
30		dest=/usr/${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
31		echo "$$here/${__objdir} -> $$dest"; ln -s $$dest ${__objdir}; \
32		if test -d /usr/${__usrobjdir} -a ! -d $$dest; then \
33			mkdir -p $$dest; \
34		else \
35			true; \
36		fi; \
37	else \
38		true ; \
39		dest=$$here/${__objdir} ; \
40		if test ! -d ${__objdir} ; then \
41			echo "making $$dest" ; \
42			mkdir $$dest; \
43		fi ; \
44	fi;
45.endif
46.endif
47