summaryrefslogtreecommitdiff
path: root/share/mk/bsd.port.mk
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>1999-03-30 07:12:06 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>1999-03-30 07:12:06 +0000
commita362cea92d0b3ba742120dacea4a1a5121bb9acb (patch)
treeb4005eecb6b24f2e0d63bc8b661671a2cf31d311 /share/mk/bsd.port.mk
parent273473262abc4bb8be839eb52ed7bf32aaa6bf80 (diff)
add obj target that works in conjuction with WRKOBJDIR;
code from op21@squish.org
Diffstat (limited to 'share/mk/bsd.port.mk')
-rw-r--r--share/mk/bsd.port.mk27
1 files changed, 25 insertions, 2 deletions
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index 67183979097..3189b702b60 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -1,6 +1,6 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
-# $OpenBSD: bsd.port.mk,v 1.80 1999/03/24 01:13:44 marc Exp $
+# $OpenBSD: bsd.port.mk,v 1.81 1999/03/30 07:12:05 marc Exp $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
@@ -28,7 +28,7 @@ OpenBSD_MAINTAINER= marc@OpenBSD.ORG
# NEED_VERSION: we need at least this version of bsd.port.mk for this
# port to build
-FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.80 1999/03/24 01:13:44 marc Exp $$
+FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.81 1999/03/30 07:12:05 marc Exp $$
.if defined(NEED_VERSION)
_VERSION_REVISION=${FULL_REVISION:M[0-9]*.*}
@@ -1274,6 +1274,29 @@ mirror-distfiles:
@make fetch __ARCH_OK=yes NO_IGNORE=yes NO_WARNINGS=yes
.endif
+# Obj
+
+.if !target(obj)
+obj:
+.if !defined(NO_WRKDIR)
+.if defined(WRKOBJDIR)
+ @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
+ @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
+ @if [ ! -L ${WRKDIR} ] || \
+ [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \
+ echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \
+ ${RM} -f ${WRKDIR}; \
+ ${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}; \
+ fi
+.else
+ @${ECHO_MSG} ">>"
+ @${ECHO_MSG} ">> Please set the WRKOBJDIR variable before using 'make obj'"
+ @${ECHO_MSG} ">>"
+ @exit 1;
+.endif
+.endif
+.endif
+
# Extract
.if !target(do-extract)