Linux-arch Archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Michal Simek <michal.simek@xilinx.com>,
	linux-arch@vger.kernel.org, David Howells <dhowells@redhat.com>,
	David Woodhouse <dwmw2@infradead.org>,
	keyrings@vger.kernel.org, Richard Weinberger <richard@nod.at>,
	Nicolas Schier <n.schier@avm.de>,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH v2 04/11] certs: refactor file cleaning
Date: Tue, 14 Dec 2021 11:53:48 +0900	[thread overview]
Message-ID: <20211214025355.1267796-5-masahiroy@kernel.org> (raw)
In-Reply-To: <20211214025355.1267796-1-masahiroy@kernel.org>

'make clean' removes files listed in 'targets'. It is redundant to
specify both 'targets' and 'clean-files'.

Move 'targets' assignments out of the ifeq-conditionals so
scripts/Makefile.clean can see them.

One effective change is that certs/certs/signing_key.x509 is now
deleted by 'make clean' instead of 'make mrproper. This certificate
is embedded in the kernel. It is not used in any way by external
module builds.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
---

(no changes since v1)

 Makefile       | 2 +-
 certs/Makefile | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 0a6ecc8bb2d2..4e8ac0730f51 100644
--- a/Makefile
+++ b/Makefile
@@ -1503,7 +1503,7 @@ MRPROPER_FILES += include/config include/generated          \
 		  debian snap tar-install \
 		  .config .config.old .version \
 		  Module.symvers \
-		  certs/signing_key.pem certs/signing_key.x509 \
+		  certs/signing_key.pem \
 		  certs/x509.genkey \
 		  vmlinux-gdb.py \
 		  *.spec
diff --git a/certs/Makefile b/certs/Makefile
index d1e0dad038ca..bb1763150547 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -22,12 +22,11 @@ $(eval $(call config_filename,SYSTEM_TRUSTED_KEYS))
 # GCC doesn't include .incbin files in -MD generated dependencies (PR#66871)
 $(obj)/system_certificates.o: $(obj)/x509_certificate_list
 
-targets += x509_certificate_list
 $(obj)/x509_certificate_list: scripts/extract-cert $(SYSTEM_TRUSTED_KEYS_SRCPREFIX)$(SYSTEM_TRUSTED_KEYS_FILENAME) FORCE
 	$(call if_changed,extract_certs,$(SYSTEM_TRUSTED_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_TRUSTED_KEYS))
 endif # CONFIG_SYSTEM_TRUSTED_KEYRING
 
-clean-files := x509_certificate_list .x509.list x509_revocation_list
+targets += x509_certificate_list
 
 ifeq ($(CONFIG_MODULE_SIG),y)
 	SIGN_KEY = y
@@ -84,18 +83,20 @@ endif
 # GCC PR#66871 again.
 $(obj)/system_certificates.o: $(obj)/signing_key.x509
 
-targets += signing_key.x509
 $(obj)/signing_key.x509: scripts/extract-cert $(X509_DEP) FORCE
 	$(call if_changed,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY))
 endif # CONFIG_MODULE_SIG
 
+targets += signing_key.x509
+
 ifeq ($(CONFIG_SYSTEM_REVOCATION_LIST),y)
 
 $(eval $(call config_filename,SYSTEM_REVOCATION_KEYS))
 
 $(obj)/revocation_certificates.o: $(obj)/x509_revocation_list
 
-targets += x509_revocation_list
 $(obj)/x509_revocation_list: scripts/extract-cert $(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(SYSTEM_REVOCATION_KEYS_FILENAME) FORCE
 	$(call if_changed,extract_certs,$(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_REVOCATION_KEYS))
 endif
+
+targets += x509_revocation_list
-- 
2.32.0


  parent reply	other threads:[~2021-12-14  2:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  2:53 [PATCH v2 00/11] kbuild: do not quote string values in Makefile Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 01/11] certs: use $< and $@ to simplify the key generation rule Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 02/11] certs: unify duplicated cmd_extract_certs and improve the log Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 03/11] certs: remove unneeded -I$(srctree) option for system_certificates.o Masahiro Yamada
2021-12-14  2:53 ` Masahiro Yamada [this message]
2021-12-14  2:53 ` [PATCH v2 05/11] certs: remove misleading comments about GCC PR Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 06/11] kbuild: stop using config_filename in scripts/Makefile.modsign Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 07/11] certs: simplify $(srctree)/ handling and remove config_filename macro Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 08/11] kbuild: do not include include/config/auto.conf from shell scripts Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 09/11] kbuild: do not quote string values in include/config/auto.conf Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 10/11] certs: move scripts/extract-cert to certs/ Masahiro Yamada
2021-12-14  2:53 ` [PATCH v2 11/11] microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV} Masahiro Yamada
2022-01-04 23:48 ` [PATCH v2 00/11] kbuild: do not quote string values in Makefile Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211214025355.1267796-5-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=n.schier@avm.de \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).