From owner-svn-src-head@freebsd.org Tue Dec 1 05:29:32 2015 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 3A23EA3EC2F; Tue, 1 Dec 2015 05:29:32 +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 ED80D1221; Tue, 1 Dec 2015 05:29:31 +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 tB15TVKO011897; Tue, 1 Dec 2015 05:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB15TVi1011896; Tue, 1 Dec 2015 05:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512010529.tB15TVi1011896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 1 Dec 2015 05:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291564 - 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.20 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: Tue, 01 Dec 2015 05:29:32 -0000 Author: bdrewery Date: Tue Dec 1 05:29:30 2015 New Revision: 291564 URL: https://svnweb.freebsd.org/changeset/base/291564 Log: META MODE: Add some basic bootstrapping support for no Makefile.depend. This will not work for bootstrapping dependencies, it will only bootstrap the top-level build directory. 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 Tue Dec 1 05:23:19 2015 (r291563) +++ head/share/mk/local.dirdeps.mk Tue Dec 1 05:29:30 2015 (r291564) @@ -84,7 +84,71 @@ DIRDEPS += \ cddl/usr.bin/ctfmerge.host .endif +# Bootstrap support. Give hints to DIRDEPS if there is no Makefile.depend* +# generated yet. This can be based on things such as SRC files and LIBADD. +# These hints will not factor into the final Makefile.depend as only what is +# 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 +.for _depfile in ${.MAKE.DEPENDFILE_PREFERENCE:T} +.if !defined(_have_depfile) && exists(${.CURDIR}/${_depfile}) +_have_depfile= .endif +.endfor +.if !defined(_have_depfile) +# Has C files. The C_DIRDEPS are shared with C++ files as well. +C_DIRDEPS= \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + +.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) +DIRDEPS+= ${C_DIRDEPS} +.if ${MK_CLANG} == "yes" +DIRDEPS+= lib/libc++ lib/libcxxrt +.else +DIRDEPS+= gnu/lib/libstdc++ gnu/lib/libsupc++ +.endif +# XXX: Clang and GCC always adds -lm currently, even when not needed. +DIRDEPS+= lib/msun +.endif +# Has yacc files. +.if !empty(SRCS:M*.y) +DIRDEPS+= usr.bin/yacc.host +.endif +.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. +DIRDEPS+= \ + ${DPADD:M${OBJTOP}*:H:C,${OBJTOP}[^/]*/,,:N.:O:u} \ + ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} +.endif +.if !empty(LIBADD) +# Also handle LIBADD for non-internal libraries. +.for _lib in ${LIBADD} +_lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,} +.if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \ + exists(${SRCTOP}/${_lib${_lib}reldir}) +DIRDEPS+= ${_lib${_lib}reldir} +.endif +.endfor +.endif # !empty(LIBADD) +.endif # no Makefile.depend* +.endif # ${RELDIR} == ${DEP_RELDIR} + +.endif # ${DEP_MACHINE} != "host" .if ${MK_STAGING} == "yes" # we need targets/pseudo/stage to prep the stage tree