From owner-svn-src-head@freebsd.org Wed Mar 9 22:44:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4879FAC9296; Wed, 9 Mar 2016 22:44:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 24A6D9EB; Wed, 9 Mar 2016 22:44:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u29MinEh093908; Wed, 9 Mar 2016 22:44:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u29MiniV093907; Wed, 9 Mar 2016 22:44:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603092244.u29MiniV093907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 9 Mar 2016 22:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296584 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2016 22:44:50 -0000 Author: bdrewery Date: Wed Mar 9 22:44:48 2016 New Revision: 296584 URL: https://svnweb.freebsd.org/changeset/base/296584 Log: DIRDEPS_BUILD: Let PROGS bootstrapping work. - Support (DP|LIB)ADD_${PROG}. - Support SRCS[._]${PROG}. - Don't bootstrap DIRDEPS while recursing. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Wed Mar 9 21:50:39 2016 (r296583) +++ head/share/mk/local.dirdeps.mk Wed Mar 9 22:44:48 2016 (r296584) @@ -90,7 +90,8 @@ DIRDEPS += \ # used will be added in and handled via [local.]gendirdeps.mk. This is not # done for MACHINE=host builds. # XXX: Include this in local.autodep.mk as well for gendirdeps without filemon. -.if ${RELDIR} == ${DEP_RELDIR} # Only do this for main build target +# Only do this for main build target +.if ${RELDIR} == ${DEP_RELDIR} && !defined(_RECURSING_PROGS) .for _depfile in ${.MAKE.DEPENDFILE_PREFERENCE:T} .if !defined(_have_depfile) && exists(${.CURDIR}/${_depfile}) _have_depfile= @@ -99,6 +100,35 @@ _have_depfile= .if !defined(_have_depfile) # KMOD does not use any stdlibs. .if !defined(KMOD) +# Gather PROGS dependencies first +.if !empty(PROGS) +_PROGS_LIBADD= +_PROGS_DPADD= +_PROGS_SRCS= +.for _prog in ${PROGS} +.for s in . _ +.if !empty(LIBADD${s}${_prog}) +_PROGS_LIBADD+= ${LIBADD${s}${_prog}} +.endif +.if !empty(DPADD${s}${_prog}) +_PROGS_DPADD+= ${DPADD${s}${_prog}} +.endif +.if !empty(SRCS${s}${_prog}) +_PROGS_SRCS+= ${SRCS${s}${_prog}} +.endif +.endfor # .for s in . _ +# Add in assumed source (bsd.prog.mk) +.if !target(${_prog}) +.if defined(PROG_CXX) +_PROGS_SRCS+= ${_prog}.cc +.else +_PROGS_SRCS+= ${_prog}.c +.endif +.endif # !target(${_prog}) +.endfor # .for _prog in ${PROGS} +.endif # !empty(PROGS) +_SRCS= ${SRCS} ${_PROGS_SRCS} + # Has C files. The C_DIRDEPS are shared with C++ files as well. C_DIRDEPS= \ gnu/lib/csu \ @@ -118,12 +148,12 @@ C_DIRDEPS= \ C_DIRDEPS+= include/gssapi .endif -.if !empty(SRCS:M*.c) +.if !empty(_SRCS:M*.c) DIRDEPS+= ${C_DIRDEPS} .endif # Has C++ files -.if !empty(SRCS:M*.cc) || !empty(SRCS:M*.C) || !empty(SRCS:M*.cpp) || \ - !empty(SRCS:M*.cxx) +.if !empty(_SRCS:M*.cc) || !empty(_SRCS:M*.C) || !empty(_SRCS:M*.cpp) || \ + !empty(_SRCS:M*.cxx) DIRDEPS+= ${C_DIRDEPS} .if ${MK_CLANG} == "yes" DIRDEPS+= lib/libc++ lib/libcxxrt @@ -135,28 +165,15 @@ DIRDEPS+= lib/msun .endif # CXX .endif # !defined(KMOD) # Has yacc files. -.if !empty(SRCS:M*.y) +.if !empty(_SRCS:M*.y) DIRDEPS+= usr.bin/yacc.host .endif -# Gather PROGS dependencies -.if !empty(PROGS) -_PROGS_LIBADD= -_PROGS_DPADD= -.for _prog in ${PROGS} -.if !empty(LIBADD.${_prog}) -_PROGS_LIBADD+= ${LIBADD.${_prog}} -.endif -.if !empty(DPADD.${_prog}) -_PROGS_DPADD+= ${DPADD.${_prog}} -.endif -.endfor -.endif # !empty(PROGS) -.if !empty(DPADD) +_DPADD= ${DPADD} ${_PROGS_DPADD} +.if !empty(_DPADD) # Taken from meta.autodep.mk (where it only does something with # BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. -_DPADD= ${DPADD} ${_PROGS_DPADD} _DP_DIRDEPS= \ ${_DPADD:O:u:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${_DPADD:O:u:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} @@ -165,9 +182,9 @@ _DP_DIRDEPS= \ DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} .endif .endif # !empty(DPADD) -.if !empty(LIBADD) -# Also handle LIBADD for non-internal libraries. _ALL_LIBADD= ${LIBADD} ${_PROGS_LIBADD} +.if !empty(_ALL_LIBADD) +# Also handle LIBADD for non-internal libraries. .for _lib in ${_ALL_LIBADD:O:u} _lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,} .if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \