Skip to content

Commit 5cca360

Browse files
committed
certs: refactor file cleaning
'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 <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
1 parent 3958f21 commit 5cca360

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ MRPROPER_FILES += include/config include/generated \
14941494
debian snap tar-install \
14951495
.config .config.old .version \
14961496
Module.symvers \
1497-
certs/signing_key.pem certs/signing_key.x509 \
1497+
certs/signing_key.pem \
14981498
certs/x509.genkey \
14991499
vmlinux-gdb.py \
15001500
*.spec

certs/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ $(eval $(call config_filename,SYSTEM_TRUSTED_KEYS))
2222
# GCC doesn't include .incbin files in -MD generated dependencies (PR#66871)
2323
$(obj)/system_certificates.o: $(obj)/x509_certificate_list
2424

25-
targets += x509_certificate_list
2625
$(obj)/x509_certificate_list: scripts/extract-cert $(SYSTEM_TRUSTED_KEYS_SRCPREFIX)$(SYSTEM_TRUSTED_KEYS_FILENAME) FORCE
2726
$(call if_changed,extract_certs,$(SYSTEM_TRUSTED_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_TRUSTED_KEYS))
2827
endif # CONFIG_SYSTEM_TRUSTED_KEYRING
2928

30-
clean-files := x509_certificate_list .x509.list x509_revocation_list
29+
targets += x509_certificate_list
3130

3231
ifeq ($(CONFIG_MODULE_SIG),y)
3332
SIGN_KEY = y
@@ -84,18 +83,20 @@ endif
8483
# GCC PR#66871 again.
8584
$(obj)/system_certificates.o: $(obj)/signing_key.x509
8685

87-
targets += signing_key.x509
8886
$(obj)/signing_key.x509: scripts/extract-cert $(X509_DEP) FORCE
8987
$(call if_changed,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY))
9088
endif # CONFIG_MODULE_SIG
9189

90+
targets += signing_key.x509
91+
9292
ifeq ($(CONFIG_SYSTEM_REVOCATION_LIST),y)
9393

9494
$(eval $(call config_filename,SYSTEM_REVOCATION_KEYS))
9595

9696
$(obj)/revocation_certificates.o: $(obj)/x509_revocation_list
9797

98-
targets += x509_revocation_list
9998
$(obj)/x509_revocation_list: scripts/extract-cert $(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(SYSTEM_REVOCATION_KEYS_FILENAME) FORCE
10099
$(call if_changed,extract_certs,$(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_REVOCATION_KEYS))
101100
endif
101+
102+
targets += x509_revocation_list

0 commit comments

Comments
 (0)