From owner-svn-src-projects@FreeBSD.ORG Sun Nov 23 00:08:24 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A2D4701; Sun, 23 Nov 2014 00:08:24 +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 5BDBE760; Sun, 23 Nov 2014 00:08:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAN08OPk088626; Sun, 23 Nov 2014 00:08:24 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAN08Nei088622; Sun, 23 Nov 2014 00:08:23 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201411230008.sAN08Nei088622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 23 Nov 2014 00:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r274902 - in projects/bmake/pkgs/pseudo: hosttools universe X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2014 00:08:24 -0000 Author: sjg Date: Sun Nov 23 00:08:22 2014 New Revision: 274902 URL: https://svnweb.freebsd.org/changeset/base/274902 Log: Leverage dirdeps.mk by tweaking _DIRDEP_USE_LEVEL so we can have a 2nd stage of dependencies computed in parallel. Reviewed by: marcel Added: projects/bmake/pkgs/pseudo/hosttools/ projects/bmake/pkgs/pseudo/hosttools/Makefile (contents, props changed) projects/bmake/pkgs/pseudo/hosttools/Makefile.depend (contents, props changed) projects/bmake/pkgs/pseudo/universe/ projects/bmake/pkgs/pseudo/universe/Makefile (contents, props changed) projects/bmake/pkgs/pseudo/universe/Makefile.depend (contents, props changed) Added: projects/bmake/pkgs/pseudo/hosttools/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bmake/pkgs/pseudo/hosttools/Makefile Sun Nov 23 00:08:22 2014 (r274902) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Added: projects/bmake/pkgs/pseudo/hosttools/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bmake/pkgs/pseudo/hosttools/Makefile.depend Sun Nov 23 00:08:22 2014 (r274902) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# This file is not autogenerated - take care! + +DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} + +DIRDEPS = \ + lib/clang/include.host \ + lib/libc++.host \ + lib/libcxxrt.host \ + share/doc/llvm/clang.host \ + usr.bin/clang/clang-tblgen.host \ + usr.bin/clang/clang.host \ + usr.bin/clang/tblgen.host \ + usr.bin/lex/lib.host \ + usr.bin/mkcsmapper_static.host \ + usr.bin/mkesdb_static.host \ + usr.bin/mkuzip.host \ + usr.bin/xinstall.host \ + usr.sbin/config.host \ + + + +.include Added: projects/bmake/pkgs/pseudo/universe/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bmake/pkgs/pseudo/universe/Makefile Sun Nov 23 00:08:22 2014 (r274902) @@ -0,0 +1,73 @@ +# $FreeBSD$ + +# This target is "special". +# +# The actual work is done via another target; +# UNIVERSE_TARGET_RELDIR is used to identify it. +# +# We leverage dirdeps.mk to run a sub-make per +# MACHINE/ARCH to each build ${UNIVERSE_TARGET_RELDIR} +# in meta mode. +# +# We simply override the level at which dirdeps.mk normally does +# its thing, and give it a DIRDEPS list that corresponds to +# ${UNIVERSE_TARGET_RELDIR}.${TARGET_SPEC} for each TARGET_SPEC we +# want. +# +# This allows the computation of dependencies for each ${TARGET_SPEC} +# to happen in parallel - avoiding a very long startup time. +# We can even export each sub-make to a different machine if using a +# cluster. +# +# The above works fine so long as our sub-makes remain independent. +# That is; none of them attempts to visit any directory for a machine +# other than the TARGET_SPEC we gave it. +# For example; to build some tool for the pseudo machine "host". +# To avoid that, our Makefile.depend lists all the hosttools we might +# need and these will thus be built before we launch the +# ${UNIVERSE_TARGET_RELDIR} sub-makes. +# Further we add a filter to skip any "host" dirdeps during those +# sub-makes. +# +# + +# this is the RELDIR of the target we build +UNIVERSE_TARGET_RELDIR?= pkgs/pseudo/the-lot + +# the list of machines +TARGET_MACHINE_LIST = i386 amd64 +# some machines have more than one arch +TARGET_ARCHES_arm?= arm armeb armv6 armv6hf + +# avoid ../Makefile.inc defining this +all: + +.include "../Makefile.inc" + +.if ${.MAKE.LEVEL} > 0 +# ok our prerequisites have been built +.if !defined(UNIVERSE_GUARD) +# just incase we end up back here, +# we cannot rely on .MAKE.LEVEL as we normally would +UNIVERSE_GUARD=1 +.export UNIVERSE_GUARD + +# we want to re-use dirdeps +_DIRDEP_USE_LEVEL = ${.MAKE.LEVEL} + +# we want our sub-makes to think they are level 0 +# and we don't want failure of one to stop all. +DIRDEP_USE_ENV= \ + MAKELEVEL=0 \ + MAKE_JOB_ERROR_TOKEN=no + + +_target_specs:= ${TARGET_MACHINE_LIST:@m@${TARGET_ARCHES_$m:U$m:@a@$m,$a@}@:O:u} + +DIRDEPS:= ${_target_specs:@t@${UNIVERSE_TARGET_RELDIR}.$t@} + +all: dirdeps + +.include +.endif +.endif Added: projects/bmake/pkgs/pseudo/universe/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bmake/pkgs/pseudo/universe/Makefile.depend Sun Nov 23 00:08:22 2014 (r274902) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# This file is not autogenerated - take care! + +# this is not normally needed, but we are not normal +.if ${.MAKE.LEVEL} == 0 +DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} + +# our role here is to build all the host tools etc. +DIRDEPS = \ + pkgs/pseudo/hosttools.host \ + + +.include +.endif