makefiles/kconfig: include out.config only when running Kconfig#16064
Conversation
|
Is there any way we can have the clean happen before menuconfig? I find myself doing a lot of: It would be nicer if I could just go Just a thought though. |
|
or have a different target |
|
@MrKevinWeiss does this solve your issue; diff --git a/makefiles/kconfig.mk b/makefiles/kconfig.mk
index 96f9b57459..d9f523f827 100644
--- a/makefiles/kconfig.mk
+++ b/makefiles/kconfig.mk
@@ -115,7 +115,7 @@ USEPKG_W_PREFIX = $(addprefix USEPKG_,$(USEPKG))
# Opens the menuconfig interface for configuration of modules using the Kconfig
# system. It will try to update the autoconf.h, which will update if needed
# (i.e. out.config changed).
-menuconfig: $(MENUCONFIG) $(KCONFIG_OUT_CONFIG)
+menuconfig: $(MENUCONFIG) $(KCONFIG_OUT_CONFIG) | $(CLEAN)
$(Q)KCONFIG_CONFIG=$(KCONFIG_OUT_CONFIG) $(MENUCONFIG) $(KCONFIG)
$(MAKE) $(KCONFIG_GENERATED_AUTOCONF_HEADER_C)
|
|
From local tests this seems to work correctly for me, @leandrolanzieri should some of this be tested in docker as well? ( |
I think the clean needs to happen before the menuconfig, with this I need to run |
|
Maybe this isn't part of this PR though. |
I think there might be a problem with this, regarding the generation of |
Not sure if that would change something, but it would be good just to be sure |
|
Works as expected for me. |
|
@MrKevinWeiss other then the |
|
Yup! A very clean solution 😆 |
|
Thanks for reviewing ! |
Contribution description
This modifies the Kconfig makefile to only source the
out.configfile into the build system when Kconfig has to run. There is no need to include it otherwise.Testing procedure
We need to make sure this change keeps Kconfig working across different workflows. I tested the following:
make menuconfig>make allshould loadout.configenv TEST_KCONFIG=1 makeshould loadout.config, using dependency modellingmake(on an application without Kconfig files) should not loadout.configmake menuconfig>make clean allshould not loadout.config(because of the clean).configfiles or menuconfig should always loadout.configuntil clean is executedTo check if there are Kconfig symbols loaded to the build system, one can add something like the following to an application makefile, and run the workflows described above (and more!) on native:
Issues/PRs references
Addresses the problem described in #16009 (comment)