Skip to contentSkip to conversation

Makefile: remove cpe-updates on clean

PATCH New Yann E. MORIN 3 participants 4 messages May 16, 2021 – May 17, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: remove cpe-updates on clean

Commit fd7312940aef (Makefile: add new missing-cpe target) added the rule to generate a set of files to update the NVD.

For an in-tree build, 'make clean' remove the output directory, so those files are removed. But for an out-of-tree build, the output directory is not removed, so those files still linger around after a clean.

Explicitly remove them on clean, to cater for both cases.

Cc Thomas Petazzoni <[email protected]>
Cc Matthew Weber <[email protected]>
---
 Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Makefile +5 -3
index 75ef7f5eb5..c3305f46e9 100644
@@ -229,6 +229,8 @@ LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
 LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
 LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
 
+CPE_UPDATES_DIR = $(BASE_DIR)/cpe-updates
+
 BR2_CONFIG = $(CONFIG_DIR)/.config
 
 # Pull in the user's configuration file
@@ -947,11 +949,11 @@ pkg-stats:
 
 .PHONY: missing-cpe
 missing-cpe:
-	$(Q)mkdir -p $(O)/cpe-updates
+	$(Q)mkdir -p $(CPE_UPDATES_DIR)
 	$(Q)cd "$(CONFIG_DIR)" ; \
 	$(TOPDIR)/support/scripts/gen-missing-cpe \
 		--nvd-path $(DL_DIR)/buildroot-nvd \
-		--output $(O)/cpe-updates
+		--output $(CPE_UPDATES_DIR)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
@@ -1087,7 +1089,7 @@ printvars:
 clean:
 	rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
 		$(BUILD_DIR) $(BASE_DIR)/staging \
-		$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR)
+		$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR) $(CPE_UPDATES_DIR)
 
 .PHONY: distclean
 distclean: clean
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 Makefile: remove cpe-updates on clean

Yann,

Quoted 17 lines

-----Original Message-----
From: Yann E. MORIN <[email protected]> On Behalf Of Yann E. MORIN
Sent: Sunday, May 16, 2021 7:43 AM
To: buildroot at buildroot.org
Cc: Yann E. MORIN <[email protected]>; Thomas Petazzoni <[email protected]>; Weber, Matthew L Collins <[email protected]>
Subject: [PATCH] Makefile: remove cpe-updates on clean

Commit fd7312940aef (Makefile: add new missing-cpe target) added the rule to generate a set of files to update the NVD.

For an in-tree build, 'make clean' remove the output directory, so those files are removed. But for an out-of-tree build, the output directory is not removed, so those files still linger around after a clean.

Quoted 5 lines

Explicitly remove them on clean, to cater for both cases.

Cc Thomas Petazzoni <[email protected]>
Cc Matthew Weber <[email protected]>
#2 lore raw

PATCH 1/1 Makefile: remove cpe-updates on clean

In reply to Yann E. MORIN
Quoted 8 lines · On Sun, 16 May 2021 14:42:37 +0200 "Yann E. MORIN" <[email protected]>…

Commit fd7312940aef (Makefile: add new missing-cpe target) added the rule to generate a set of files to update the NVD.

For an in-tree build, 'make clean' remove the output directory, so those files are removed. But for an out-of-tree build, the output directory is not removed, so those files still linger around after a clean.

Quoted 5 lines

Explicitly remove them on clean, to cater for both cases.

Cc Thomas Petazzoni <[email protected]>
Cc Matthew Weber <[email protected]>

Yes, indeed:

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author Applied
#3 lore raw

PATCH 1/1 Makefile: remove cpe-updates on clean

In reply to Yann E. MORIN

All,

On 2021-05-16 14:42 +0200, Yann E. MORIN spake thusly:

Quoted 8 lines

Commit fd7312940aef (Makefile: add new missing-cpe target) added the rule to generate a set of files to update the NVD.

For an in-tree build, 'make clean' remove the output directory, so those files are removed. But for an out-of-tree build, the output directory is not removed, so those files still linger around after a clean.

Quoted 5 lines

Explicitly remove them on clean, to cater for both cases.

Cc Thomas Petazzoni <[email protected]>
Cc Matthew Weber <[email protected]>

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 47 lines
---
 Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Makefile +5 -3
index 75ef7f5eb5..c3305f46e9 100644
@@ -229,6 +229,8 @@ LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
 LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
 LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
 
+CPE_UPDATES_DIR = $(BASE_DIR)/cpe-updates
+
 BR2_CONFIG = $(CONFIG_DIR)/.config
 
 # Pull in the user's configuration file
@@ -947,11 +949,11 @@ pkg-stats:
 
 .PHONY: missing-cpe
 missing-cpe:
-	$(Q)mkdir -p $(O)/cpe-updates
+	$(Q)mkdir -p $(CPE_UPDATES_DIR)
 	$(Q)cd "$(CONFIG_DIR)" ; \
 	$(TOPDIR)/support/scripts/gen-missing-cpe \
 		--nvd-path $(DL_DIR)/buildroot-nvd \
-		--output $(O)/cpe-updates
+		--output $(CPE_UPDATES_DIR)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
@@ -1087,7 +1089,7 @@ printvars:
 clean:
 	rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
 		$(BUILD_DIR) $(BASE_DIR)/staging \
-		$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR)
+		$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR) $(CPE_UPDATES_DIR)
 
 .PHONY: distclean
 distclean: clean
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'