bsd.obj.mk revision 1.16 1 # $NetBSD: bsd.obj.mk,v 1.16 1999/02/12 01:10:07 lukem Exp $
2
3 .if ${MKOBJ} == "no"
4 obj:
5 .else
6
7 .if defined(OBJMACHINE)
8 __objdir= obj.${MACHINE}
9 .else
10 __objdir= obj
11 .endif
12
13 .if defined(USR_OBJMACHINE)
14 __usrobjdir= ${BSDOBJDIR}.${MACHINE}
15 __usrobjdirpf=
16 .else
17 __usrobjdir= ${BSDOBJDIR}
18 .if defined(OBJMACHINE)
19 __usrobjdirpf= .${MACHINE}
20 .else
21 __usrobjdirpf=
22 .endif
23 .endif
24
25 obj:
26 @cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
27 here=`/bin/pwd`; subdir=$${here#${BSDSRCDIR}/}; \
28 if test $$here != $$subdir ; then \
29 dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
30 echo "$$here/${__objdir} -> $$dest"; \
31 rm -rf ${__objdir}; \
32 ln -s $$dest ${__objdir}; \
33 if test -d ${__usrobjdir} -a ! -d $$dest; then \
34 mkdir -p $$dest; \
35 else \
36 true; \
37 fi; \
38 else \
39 true ; \
40 dest=$$here/${__objdir} ; \
41 if test ! -d ${__objdir} ; then \
42 echo "making $$dest" ; \
43 mkdir $$dest; \
44 fi ; \
45 fi;
46 .endif
47
48 print-objdir:
49 @echo ${.OBJDIR}
50