From patchwork Mon Mar 18 20:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1913329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Ktwsxh0/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=dWZA9oBL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tz6SG19xJz23sN for ; Tue, 19 Mar 2024 07:50:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fI27lhJzizUOIC4DJ2ZCyt6HoJ3Z/l1jyyKT5fBFmnk=; b=Ktwsxh0/qDmzE7 wU/Vi2eYD4/rRSrn6OkIhCpExHdwu48prE7VJ5e2UYDv7KAOmaMjKsb7wF5TAGSowbe/HRpdhsELU r2W+cSYhNoaU3GmA0Df4y2Ba7o4XZyGXnrLaqccp1kvaUR2fQLlvM9RHQTrTDok6KS8ncbOVaPiEm rYy2kcHEym5HAyiJfqiGxHp6lh5tkckUM0aFfIMbf419CSEhpTPGstUT+M88qF86Uh1aU2gMKoLlO iNEBXWz8yki5v/VQpMwpu8hUD0niJ9wOMprPOQalsuI086cCQKyxe2A1WYG2cbi3Ltx6HF99tZ0TN b12BdjXampLKkTW+4vCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmJvs-0000000A5t0-0yp5; Mon, 18 Mar 2024 20:50:08 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmJvp-0000000A5s2-07iO for opensbi@lists.infradead.org; Mon, 18 Mar 2024 20:50:06 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1e0000cdf99so17120105ad.0 for ; Mon, 18 Mar 2024 13:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1710795003; x=1711399803; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bcRg6fLA3+A44NX1QaY8ElVt6iu6YVUnAVmiSXbJu2o=; b=dWZA9oBLMqCZ7xrK/LMV5BzfMBsmaULAfoAykWbJavzP82Xx8sw4EBDRuuqDrsnaun mlketM0BouUdwcw8bfJGmdyctka2AtsBbMksw14R0Tyg2DoKPbJJJcw/AAhGLy3ISZff +XO0pD9BGwIlHQ1hXbYf3guut4KLDQmgC987ULiQohQzK6UQWac7/zF82B96TFDcvGEu BOzFLpopHePIEckkN26P/6sFm3ElLHt5jDeWaVoaeyNpFbWSrajOvJ1gnlOd9r51t69O XqpB8n7R7fQ/tjjkNNBM2p947kvRd9w+r+2RmIKbNMWUycJ346ET50n9nVTyQXfcDT3D VFrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710795003; x=1711399803; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bcRg6fLA3+A44NX1QaY8ElVt6iu6YVUnAVmiSXbJu2o=; b=ORu9M2PJeG/y5ItvwgnuRX1KOsOztvR3jQIWbpOeU0ETWnOWaD3dDEaF7aN9S/gM2S T/GeqF83q4EbteU2rFgPteqBj/BDAntVOlLnA4yj6chAp4CF+9XgIr8OJ0WqtKSkz5Kd 2aSiE428n7LDoGADaPO/PisyhDam+xxNk45CGvMHMW95F0qXipoZdK9Mer0CeFiUjSNi jc6g421tHBvuAiunveXnlnAJDb3JvANJJ/YuX6EiI6WjVh5RaAb7jhxmr3qiqIDJyy+J dJztwbf7/rphsr9WQFWQ3EC+rAPDEk7Aky1IdhmZQq840Wqif95Diwa68UV/NkhI1Lf6 G22g== X-Gm-Message-State: AOJu0YxzD0bfYMaBb/A7Ib7ZaQjkcISdYXt8IxdByqiiY7oM3idPrdhh HzMQ5tEs/JG1iSCwqd0PlOL6gzY8Ko2XoTbYCZf/MUGDPRbfJCK62tE7JBfzSqyoj36AW45CsZk mtktRPEqmNg1o64darkbvg1th/GG5cxzM7YjtPqX/vb1K984bfCd4gvsud//1CFV9M7rVoMeHxZ bmtBlX60qZuTrO3IUqgJQsf5+pDvLNwVF8PY+NVsTgNghbdiRItyY= X-Google-Smtp-Source: AGHT+IEslmrtsRSDAfvK5lAZXdMLyvKoTrlx4YPjMblBOMpaEnWWb/MlSYBngra9jhRA5Ae2EQ74uw== X-Received: by 2002:a17:902:c285:b0:1da:1c72:2ca7 with SMTP id i5-20020a170902c28500b001da1c722ca7mr13614350pld.29.1710795003363; Mon, 18 Mar 2024 13:50:03 -0700 (PDT) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id q6-20020a170902a3c600b001dee3fe3c1asm8772073plb.258.2024.03.18.13.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 13:50:02 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 1/2] Makefile: Respect manual changes to .config Date: Mon, 18 Mar 2024 13:49:40 -0700 Message-ID: <20240318205002.366134-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.43.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240318_135005_247439_6AB2ADEC X-CRM114-Status: UNSURE ( 7.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The .config file may be manually edited or copied from another location. Since genconfig.py is responsible for generating auto.conf (the Makefile fragment) and autoconf.h (the C header) from .config, [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:631 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The .config file may be manually edited or copied from another location. Since genconfig.py is responsible for generating auto.conf (the Makefile fragment) and autoconf.h (the C header) from .config, it must be run any time .config changes, not just when running menuconfig. Fixes: 662e631ccef2 ("Makefile: Add initial kconfig support for each platform") Signed-off-by: Samuel Holland Reviewed-by: Anup Patel Tested-by: Anup Patel --- Makefile | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 680c19a4..c3d45460 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ export PYTHONDONTWRITEBYTECODE=1 export KCONFIG_DIR=$(platform_build_dir)/kconfig export KCONFIG_AUTOLIST=$(KCONFIG_DIR)/auto.list export KCONFIG_AUTOHEADER=$(KCONFIG_DIR)/autoconf.h +export KCONFIG_AUTOCONFIG=$(KCONFIG_DIR)/auto.conf export KCONFIG_AUTOCMD=$(KCONFIG_DIR)/auto.conf.cmd export KCONFIG_CONFIG=$(KCONFIG_DIR)/.config # Additional exports for include paths in Kconfig files @@ -216,7 +217,6 @@ ifdef PLATFORM menuconfig: $(platform_src_dir)/Kconfig $(src_dir)/Kconfig $(CMD_PREFIX)mkdir -p $(KCONFIG_DIR) $(CMD_PREFIX)$(src_dir)/scripts/Kconfiglib/menuconfig.py $(src_dir)/Kconfig - $(CMD_PREFIX)$(src_dir)/scripts/Kconfiglib/genconfig.py --header-path $(KCONFIG_AUTOHEADER) --sync-deps $(KCONFIG_DIR) --file-list $(KCONFIG_AUTOLIST) $(src_dir)/Kconfig .PHONY: savedefconfig savedefconfig: $(platform_src_dir)/Kconfig $(src_dir)/Kconfig @@ -226,14 +226,19 @@ savedefconfig: $(platform_src_dir)/Kconfig $(src_dir)/Kconfig $(KCONFIG_CONFIG): $(platform_src_dir)/configs/$(PLATFORM_DEFCONFIG) $(platform_src_dir)/Kconfig $(src_dir)/Kconfig $(CMD_PREFIX)mkdir -p $(KCONFIG_DIR) $(CMD_PREFIX)$(src_dir)/scripts/Kconfiglib/defconfig.py --kconfig $(src_dir)/Kconfig $(platform_src_dir)/configs/$(PLATFORM_DEFCONFIG) + +$(KCONFIG_AUTOCONFIG): $(KCONFIG_CONFIG) $(CMD_PREFIX)$(src_dir)/scripts/Kconfiglib/genconfig.py --header-path $(KCONFIG_AUTOHEADER) --sync-deps $(KCONFIG_DIR) --file-list $(KCONFIG_AUTOLIST) $(src_dir)/Kconfig -$(KCONFIG_AUTOCMD): $(KCONFIG_CONFIG) - $(CMD_PREFIX)mkdir -p $(KCONFIG_DIR) +$(KCONFIG_AUTOHEADER): $(KCONFIG_AUTOCONFIG); + +$(KCONFIG_AUTOLIST): $(KCONFIG_AUTOCONFIG); + +$(KCONFIG_AUTOCMD): $(KCONFIG_AUTOLIST) $(CMD_PREFIX)printf "%s: " $(KCONFIG_CONFIG) > $(KCONFIG_AUTOCMD) $(CMD_PREFIX)cat $(KCONFIG_AUTOLIST) | tr '\n' ' ' >> $(KCONFIG_AUTOCMD) -include $(KCONFIG_CONFIG) +include $(KCONFIG_AUTOCONFIG) include $(KCONFIG_AUTOCMD) endif @@ -504,14 +509,14 @@ $(build_dir)/lib/libsbi.a: $(libsbi-objs-path-y) $(platform_build_dir)/lib/libplatsbi.a: $(libsbi-objs-path-y) $(libsbiutils-objs-path-y) $(platform-objs-path-y) $(call compile_ar,$@,$^) -$(build_dir)/%.dep: $(src_dir)/%.carray $(KCONFIG_CONFIG) - $(call compile_gen_dep,$@,.c,$< $(KCONFIG_CONFIG)) +$(build_dir)/%.dep: $(src_dir)/%.carray $(KCONFIG_AUTOHEADER) + $(call compile_gen_dep,$@,.c,$< $(KCONFIG_AUTOHEADER)) $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) $(build_dir)/%.c: $(src_dir)/%.carray $(call compile_carray,$@,$<) -$(build_dir)/%.dep: $(src_dir)/%.c $(KCONFIG_CONFIG) +$(build_dir)/%.dep: $(src_dir)/%.c $(KCONFIG_AUTOHEADER) $(call compile_cc_dep,$@,$<) $(build_dir)/%.o: $(src_dir)/%.c @@ -525,24 +530,24 @@ $(build_dir)/lib/sbi/sbi_init.o: $(libsbi_dir)/sbi_init.c FORCE $(call compile_cc,$@,$<) endif -$(build_dir)/%.dep: $(src_dir)/%.S $(KCONFIG_CONFIG) +$(build_dir)/%.dep: $(src_dir)/%.S $(KCONFIG_AUTOHEADER) $(call compile_as_dep,$@,$<) $(build_dir)/%.o: $(src_dir)/%.S $(call compile_as,$@,$<) # Rules for platform sources -$(platform_build_dir)/%.dep: $(platform_src_dir)/%.carray $(KCONFIG_CONFIG) - $(call compile_gen_dep,$@,.c,$< $(KCONFIG_CONFIG)) +$(platform_build_dir)/%.dep: $(platform_src_dir)/%.carray $(KCONFIG_AUTOHEADER) + $(call compile_gen_dep,$@,.c,$< $(KCONFIG_AUTOHEADER)) $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) $(platform_build_dir)/%.c: $(platform_src_dir)/%.carray $(call compile_carray,$@,$<) -$(platform_build_dir)/%.dep: $(platform_src_dir)/%.c $(KCONFIG_CONFIG) +$(platform_build_dir)/%.dep: $(platform_src_dir)/%.c $(KCONFIG_AUTOHEADER) $(call compile_cc_dep,$@,$<) -$(platform_build_dir)/%.o: $(platform_src_dir)/%.c $(KCONFIG_CONFIG) +$(platform_build_dir)/%.o: $(platform_src_dir)/%.c $(KCONFIG_AUTOHEADER) $(call compile_cc,$@,$<) $(platform_build_dir)/%.dep: $(platform_src_dir)/%.S @@ -551,8 +556,8 @@ $(platform_build_dir)/%.dep: $(platform_src_dir)/%.S $(platform_build_dir)/%.o: $(platform_src_dir)/%.S $(call compile_as,$@,$<) -$(platform_build_dir)/%.dep: $(platform_src_dir)/%.dts $(KCONFIG_CONFIG) - $(call compile_gen_dep,$@,.dtb,$< $(KCONFIG_CONFIG)) +$(platform_build_dir)/%.dep: $(platform_src_dir)/%.dts $(KCONFIG_AUTOHEADER) + $(call compile_gen_dep,$@,.dtb,$< $(KCONFIG_AUTOHEADER)) $(call compile_gen_dep,$@,.c,$(@:.dep=.dtb)) $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) @@ -569,26 +574,26 @@ $(platform_build_dir)/%.bin: $(platform_build_dir)/%.elf $(platform_build_dir)/%.elf: $(platform_build_dir)/%.o $(platform_build_dir)/%.elf.ld $(platform_build_dir)/lib/libplatsbi.a $(call compile_elf,$@,$@.ld,$< $(platform_build_dir)/lib/libplatsbi.a) -$(platform_build_dir)/%.dep: $(src_dir)/%.ldS $(KCONFIG_CONFIG) +$(platform_build_dir)/%.dep: $(src_dir)/%.ldS $(KCONFIG_AUTOHEADER) $(call compile_cpp_dep,$@,.ld,$<) $(platform_build_dir)/%.ld: $(src_dir)/%.ldS $(call compile_cpp,$@,$<) -$(platform_build_dir)/%.dep: $(src_dir)/%.carray $(KCONFIG_CONFIG) - $(call compile_gen_dep,$@,.c,$< $(KCONFIG_CONFIG)) +$(platform_build_dir)/%.dep: $(src_dir)/%.carray $(KCONFIG_AUTOHEADER) + $(call compile_gen_dep,$@,.c,$< $(KCONFIG_AUTOHEADER)) $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) $(platform_build_dir)/%.c: $(src_dir)/%.carray $(call compile_carray,$@,$<) -$(platform_build_dir)/%.dep: $(src_dir)/%.c $(KCONFIG_CONFIG) +$(platform_build_dir)/%.dep: $(src_dir)/%.c $(KCONFIG_AUTOHEADER) $(call compile_cc_dep,$@,$<) $(platform_build_dir)/%.o: $(src_dir)/%.c $(call compile_cc,$@,$<) -$(platform_build_dir)/%.dep: $(src_dir)/%.S $(KCONFIG_CONFIG) +$(platform_build_dir)/%.dep: $(src_dir)/%.S $(KCONFIG_AUTOHEADER) $(call compile_as_dep,$@,$<) $(platform_build_dir)/%.o: $(src_dir)/%.S