summaryrefslogtreecommitdiff
path: root/share/mk/bsd.obj.mk
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-18 08:53:40 +0000
commitd6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch)
treeece253b876159b39c620e62b6c9b1174642e070e /share/mk/bsd.obj.mk
initial import of NetBSD tree
Diffstat (limited to 'share/mk/bsd.obj.mk')
-rw-r--r--share/mk/bsd.obj.mk48
1 files changed, 48 insertions, 0 deletions
diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk
new file mode 100644
index 00000000000..2e42f019187
--- /dev/null
+++ b/share/mk/bsd.obj.mk
@@ -0,0 +1,48 @@
+# $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
+
+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