From owner-svn-ports-head@FreeBSD.ORG Tue Apr 1 14:12:00 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1E7B1A4; Tue, 1 Apr 2014 14:12:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E60E934; Tue, 1 Apr 2014 14:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EC0fp010287; Tue, 1 Apr 2014 14:12:00 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EC0Zx010286; Tue, 1 Apr 2014 14:12:00 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404011412.s31EC0Zx010286@svn.freebsd.org> From: Bryan Drewery Date: Tue, 1 Apr 2014 14:12:00 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r349856 - head/Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:12:00 -0000 Author: bdrewery Date: Tue Apr 1 14:12:00 2014 New Revision: 349856 URL: http://svnweb.freebsd.org/changeset/ports/349856 QAT: https://qat.redports.org/buildarchive/r349856/ Log: - Add comments around all of the DEP/SEQ/default target code and try to make more understandable. No functional change. With hat: portmgr Modified: head/Mk/bsd.port.mk Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Tue Apr 1 14:09:38 2014 (r349855) +++ head/Mk/bsd.port.mk Tue Apr 1 14:12:00 2014 (r349856) @@ -6421,6 +6421,9 @@ _TARGETS_STAGES= SANITY PKG FETCH EXTRAC _TARGETS_STAGES+= STAGE .endif +# Define the SEQ of actions to take when each target is ran, and which targets +# it depends on before running its SEQ. + _SANITY_SEQ= post-chroot pre-everything check-makefile \ show-warnings show-dev-warnings show-dev-errors \ check-categories check-makevars check-desktop-entries \ @@ -6533,8 +6536,17 @@ _${_t}_REAL_SUSEQ+= ${s} .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ} .endfor +# Define all of the main targets which depend on a sequence of other targets. +# See above *_SEQ and *_DEP. The _DEP will run before this defined target is +# ran. The _SEQ will run as this target once _DEP is satisfied. + .for target in extract patch configure build stage install package +# Check if config dialog needs to show and execute it if needed. If is it not +# needed (_OPTIONS_OK), then just depend on the cookie which is defined later +# to depend on the *_DEP and execute the *_SEQ. +# If options are required, execute config-conditional and then re-execute the +# target noting that config is no longer needed. .if !target(${target}) && defined(_OPTIONS_OK) _PHONY_TARGETS+= ${target} ${target}: ${${target:U}_COOKIE} @@ -6546,40 +6558,42 @@ ${target}: config-conditional .if !exists(${${target:U}_COOKIE}) +# Define the real target behavior. Depend on the target's *_DEP. Execute +# the target's *_SEQ. Also handle su and USE_SUBMAKE needs. .if ${UID} != 0 && defined(_${target:U}_REAL_SUSEQ) && !defined(INSTALL_AS_USER) -.if defined(USE_SUBMAKE) +. if defined(USE_SUBMAKE) ${${target:U}_COOKIE}: ${_${target:U}_DEP} @cd ${.CURDIR} && ${MAKE} ${_${target:U}_REAL_SEQ} -.else +. else # !USE_SUBMAKE ${${target:U}_COOKIE}: ${_${target:U}_DEP} ${_${target:U}_REAL_SEQ} -.endif +. endif # USE_SUBMAKE @${ECHO_MSG} "===> Switching to root credentials for '${target}' target" @cd ${.CURDIR} && \ ${SU_CMD} "${MAKE} ${_${target:U}_REAL_SUSEQ}" @${ECHO_MSG} "===> Returning to user credentials" @${TOUCH} ${TOUCH_FLAGS} ${.TARGET} -.else -.if defined(USE_SUBMAKE) +.else # No SU needed +. if defined(USE_SUBMAKE) ${${target:U}_COOKIE}: ${_${target:U}_DEP} @cd ${.CURDIR} && \ ${MAKE} ${_${target:U}_REAL_SEQ} ${_${target:U}_REAL_SUSEQ} @${TOUCH} ${TOUCH_FLAGS} ${.TARGET} -.else +. else # !USE_SUBMAKE ${${target:U}_COOKIE}: ${_${target:U}_DEP} ${_${target:U}_REAL_SEQ} ${_${target:U}_REAL_SUSEQ} @${TOUCH} ${TOUCH_FLAGS} ${.TARGET} -.endif -.endif +. endif # USE_SUBMAKE +.endif # SU needed -.else +.else # exists(cookie) ${${target:U}_COOKIE}:: @if [ -e ${.TARGET} ]; then \ ${DO_NADA}; \ else \ cd ${.CURDIR} && ${MAKE} ${.TARGET}; \ fi -.endif +.endif # !exists(cookie) -.endfor +.endfor # foreach(targets) .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg