Skip to contentSkip to conversation

Makefile: Remove config-devices.mak on "make clean"

PATCH In review Peter Maydell 2 participants 3 messages Jul 17, 2020 – Jul 20, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Remove config-devices.mak on "make clean"

The config-devices.mak files are generated by "make", and so they should be deleted by "make clean".

(This is different from config-host.mak and config-all-disas.mak, which are created by "configure" and so only deleted by "make distclen".)

If we don't delete these files on "make clean", then the build tree is left in a state where it has the config-devices.mak file but not the config-devices.mak.d file, and make will not realize that it needs to rebuild config-devices.mak if, for instance, hw/sd/Kconfig changes.

NB: config-all-devices.mak is also generated by "make", but we already remove it on "make clean".

---
I didn't remove the existing 'rm -f $(SUBDIR_DEVICES_MAK)' from the 'distclean' rules on the basis that config-all-devices.mak is explicitly removed in both 'distclean' and 'clean', despite 'distclean' depending on 'clean'...

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 32345c610ee..c2120d8d48d 100644
@@ -775,6 +775,7 @@ clean: recurse-clean
 	rm -f storage-daemon/qapi/qapi-gen-timestamp
 	rm -rf qga/qapi-generated
 	rm -f config-all-devices.mak
+	rm -f $(SUBDIR_DEVICES_MAK)
 
 VERSION ?= $(shell cat VERSION)
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Peter Maydell

The config-devices.mak files are generated by "make", and so they should be deleted by "make clean".

(This is different from config-host.mak and config-all-disas.mak, which are created by "configure" and so only deleted by "make distclen".)

typo "distclean"

Quoted 10 lines

If we don't delete these files on "make clean", then the build tree is left in a state where it has the config-devices.mak file but not the config-devices.mak.d file, and make will not realize that it needs to rebuild config-devices.mak if, for instance, hw/sd/Kconfig changes.

NB: config-all-devices.mak is also generated by "make", but we already remove it on "make clean".

Quoted 23 lines

---
I didn't remove the existing 'rm -f $(SUBDIR_DEVICES_MAK)' from the 'distclean' rules on the basis that config-all-devices.mak is explicitly removed in both 'distclean' and 'clean', despite 'distclean' depending on 'clean'...

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 32345c610ee..c2120d8d48d 100644
@@ -775,6 +775,7 @@ clean: recurse-clean
 	rm -f storage-daemon/qapi/qapi-gen-timestamp
 	rm -rf qga/qapi-generated
 	rm -f config-all-devices.mak
+	rm -f $(SUBDIR_DEVICES_MAK)
 
 VERSION ?= $(shell cat VERSION)
 
author Applied
#2 lore raw
Quoted 18 lines · Philippe Mathieu-Daudé
Quoted 6 lines · Peter Maydell

The config-devices.mak files are generated by "make", and so they should be deleted by "make clean".

(This is different from config-host.mak and config-all-disas.mak, which are created by "configure" and so only deleted by "make distclen".)

typo "distclean"

Quoted 7 lines

If we don't delete these files on "make clean", then the build tree is left in a state where it has the config-devices.mak file but not the config-devices.mak.d file, and make will not realize that it needs to rebuild config-devices.mak if, for instance, hw/sd/Kconfig changes.

Quoted 7 lines
Quoted 3 lines

NB: config-all-devices.mak is also generated by "make", but we already remove it on "make clean".

Applied to master with the commit-message fixes so I could merge the i2c pullreq.

thanks
-- PMM