From patchwork Wed Jun 1 18:05:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 577809 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp846087mab; Wed, 1 Jun 2022 11:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMl5+bPc/r7wMyZF2tiKOwLS8xpYrjxNPaHxcchhxYlJROGeGHZ0wB0FQkePyl5QAJR4wu X-Received: by 2002:a05:6214:dab:b0:464:5a56:fba3 with SMTP id h11-20020a0562140dab00b004645a56fba3mr11112461qvh.107.1654107296182; Wed, 01 Jun 2022 11:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654107296; cv=none; d=google.com; s=arc-20160816; b=bW7FaYbeVBJ+hWPnXR37e8hlaHAob84MXOF4PmM0cxKylvxr+B6yEs0IOSpCISUoi2 FbLZ2v9jJ45bOGFWi5VFpWWQ7ARBLjypig6wh0uxNhNKtwpMOhPkymNRcSF9s5w9I38N rfdkKQ/aAIFWDyEU2Hk5JLCs75LcTCHzQ+6c4ILqNVNh82pGn8NimO7L2K+WdTlgFE3R r1ctToqqKsKs56qLbhMOr2g6v0cgRe/754hqn4lFo3IK/8frwXrx0u4Bxwo8L0BE1G4m 6Au09nZL604q3HXTRDrc9PlQCzDEu+xeGOrZx4O+jLFeFd4sVQ9pidPKFmBOjNn7ePd5 fHsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XyOIPduSP6mWZwGS3Z+Ma1uowcWemZ8L6d4bwTuU7ig=; b=Z7clHHSWMA2TN4koZJyDgHdDhNTFfpwkuNzPbsRRqIjmrDqJjeU8mKgL5I/i7c9dru WMLKsBiaAbYJG15sOWhvmNbHqaz5L+pch0NWis4flyeIm30bDeXtACqXeDqJw7c3JQg/ dLRV1Fdbw7FXfQc5HGRY9TaCmDamGt4npngBtOpnxR6NeYjGnCkvfANHHu5MSyi8tOF6 uw9o6Whba9HOKz4GP621FFQPuuMrKMX2DVT66srLuzfGHnA1ACTVwJMoWQoZ9XSpHs2I hZwEt/oONXWvJLc10V5bBSq6EEmyg21W/OTb0Q2jto2OYjF+sHbsZDdRnhAxLf7zdjoy P3dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xsd7TfeV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id kc2-20020a056214410200b0046435854368si937107qvb.93.2022.06.01.11.14.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Jun 2022 11:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xsd7TfeV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwSrv-0001oG-OW for patch@linaro.org; Wed, 01 Jun 2022 14:14:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwSr6-0001h7-91 for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:04 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:37603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwSr1-0006XT-QB for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:03 -0400 Received: by mail-ej1-x62f.google.com with SMTP id rq11so5429374ejc.4 for ; Wed, 01 Jun 2022 11:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XyOIPduSP6mWZwGS3Z+Ma1uowcWemZ8L6d4bwTuU7ig=; b=Xsd7TfeVzHOuE+pILtMj2Yc06jMzg9xBHHBvlnxg9cteicMyWgGcRsphC01d+8rvIn ptMNhmpfBvvjz28CSXyTsBTM8KPVH9fM3Giwc+7vbxq/wQQ3LW07TJwuVRv/z6tKDQYl Y1CcYbi2WyGGoh6F9xez1DX+Xds7tYqym349sF/OFQlfGYLVcDvZx4jaTV8jN7SGU001 zM3zOFypiN/hdr3QzK7w7CzNux9oO9Q5q9+ZQQYPJ/h1BHL6lR0HERIWKSH0zBcFn5Ii QeUrlGk1xysMoOS/tDyQ25NWn3lCKywVX74RxwgZ8mbPigposQcaKtpxKi4G6XnDQjai EFMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XyOIPduSP6mWZwGS3Z+Ma1uowcWemZ8L6d4bwTuU7ig=; b=rxCt46fVlzqIfPptywjKFzwvr8yv9Z9vjxcV3//Hcgl144oKvJBQ9iOUaKkfgJ1kv5 rnm9Ufh+G9ocbTbPl6QD6TyC8ASYyIGzk6ScM6ftrOaSBH0RkP0ekZctEdywpahWinqc Az1Ik1OGhUgNZ1FMl7Smw1MZWEXJKquKAVj2qgKOaHzgaPVHPQNhgoVw1mz+5VBib2RP eTeu2uqdN8NIUUpqnOoYEogKj3LSia5t1AwtGDpWofEJgA5Ry3xAlRhktpyftlkkd1YQ psqA8ifDB/NAXBIxgO3urNToF9E02H4dzvpLjhm/s0B2qkoA2uV8/F8pwfNsULbb42Zd MUPA== X-Gm-Message-State: AOAM531Dc5MWk3mLpiB7nDr7mWQ1g0IoyF0HQHY+BBetJdArati+GA4j m/3/V/1VFUzfYKXSRMPNjZ/Yiw== X-Received: by 2002:a17:907:9714:b0:6ff:338f:b4d7 with SMTP id jg20-20020a170907971400b006ff338fb4d7mr738417ejc.718.1654107238090; Wed, 01 Jun 2022 11:13:58 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id fx10-20020a170906b74a00b00708743e31b2sm645939ejb.27.2022.06.01.11.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:13:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 174541FFC6; Wed, 1 Jun 2022 19:05:39 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Cc: qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , John Snow , Cleber Rosa Subject: [PULL 14/33] build: add a more generic way to specify make->ninja dependencies Date: Wed, 1 Jun 2022 19:05:18 +0100 Message-Id: <20220601180537.2329566-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601180537.2329566-1-alex.bennee@linaro.org> References: <20220601180537.2329566-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Let any make target specify ninja goals that needs to be built for it (though selecting the goals is _not_ recursive on depending targets) instead of having a custom mechanism only for "make check" and "make bench". Signed-off-by: Paolo Bonzini Message-Id: <20220517092616.1272238-4-pbonzini@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20220527153603.887929-15-alex.bennee@linaro.org> diff --git a/Makefile b/Makefile index fad312040f..3c0d89057e 100644 --- a/Makefile +++ b/Makefile @@ -145,8 +145,7 @@ NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \ $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \ -d keepdepfile ninja-cmd-goals = $(or $(MAKECMDGOALS), all) -ninja-cmd-goals += $(foreach t, $(.check.build-suites), $(.check-$t.deps)) -ninja-cmd-goals += $(foreach t, $(.bench.build-suites), $(.bench-$t.deps)) +ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g)))) makefile-targets := build.ninja ctags TAGS cscope dist clean uninstall # "ninja -t targets" also lists all prerequisites. If build system diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index 304634b71e..0fe81efbbc 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -81,12 +81,12 @@ def emit_prolog(suites, prefix): def emit_suite_deps(name, suite, prefix): deps = ' '.join(suite.deps) - targets = f'{prefix}-{name} {prefix}-report-{name}.junit.xml {prefix} {prefix}-report.junit.xml' + targets = [f'{prefix}-{name}', f'{prefix}-report-{name}.junit.xml', f'{prefix}', f'{prefix}-report.junit.xml', + f'{prefix}-build'] print() print(f'.{prefix}-{name}.deps = {deps}') - print(f'ifneq ($(filter {prefix}-build {targets}, $(MAKECMDGOALS)),)') - print(f'.{prefix}.build-suites += {name}') - print(f'endif') + for t in targets: + print(f'.ninja-goals.{t} += $(.{prefix}-{name}.deps)') def emit_suite(name, suite, prefix): emit_suite_deps(name, suite, prefix)