diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 1999-03-30 07:12:06 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 1999-03-30 07:12:06 +0000 |
commit | a362cea92d0b3ba742120dacea4a1a5121bb9acb (patch) | |
tree | b4005eecb6b24f2e0d63bc8b661671a2cf31d311 | |
parent | 273473262abc4bb8be839eb52ed7bf32aaa6bf80 (diff) |
add obj target that works in conjuction with WRKOBJDIR;
code from op21@squish.org
-rw-r--r-- | share/mk/bsd.port.mk | 27 | ||||
-rw-r--r-- | share/mk/bsd.port.subdir.mk | 4 |
2 files changed, 27 insertions, 4 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) diff --git a/share/mk/bsd.port.subdir.mk b/share/mk/bsd.port.subdir.mk index 83358e53489..799088890dd 100644 --- a/share/mk/bsd.port.subdir.mk +++ b/share/mk/bsd.port.subdir.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 -# $OpenBSD: bsd.port.subdir.mk,v 1.4 1998/12/16 19:26:31 marc Exp $ +# $OpenBSD: bsd.port.subdir.mk,v 1.5 1999/03/30 07:12:05 marc Exp $ # FreeBSD Id: bsd.port.subdir.mk,v 1.20 1997/08/22 11:16:15 asami Exp # # The include file <bsd.port.subdir.mk> contains the default targets @@ -81,7 +81,7 @@ ${SUBDIR}:: .for __target in all fetch fetch-list package extract configure \ build clean depend describe distclean reinstall \ - tags checksum mirror-distfiles + tags checksum mirror-distfiles obj .if !target(__target) ${__target}: _SUBDIRUSE .endif |