add obj target that works in conjuction with WRKOBJDIR;

code from op21@squish.org
This commit is contained in:
marc 1999-03-30 07:12:05 +00:00
parent 94dbc41655
commit aa5ff3fb17
2 changed files with 27 additions and 4 deletions

View File

@ -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)

View File

@ -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