diff mbox series

[1/2] Makefile: Run defconfig files through the C preprocessor

Message ID 20231101170519.39627-2-afd@ti.com
State Accepted
Commit 2027e99e61aab6fd8b06e2d752e0e538cff26eb6
Delegated to: Tom Rini
Headers show
Series Allow defconfigs defined from fragments | expand

Commit Message

Andrew Davis Nov. 1, 2023, 5:05 p.m. UTC
This allows us to use some of the normal preprocessor directives inside
defconfig files. Such as #define and #include.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 scripts/kconfig/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nishanth Menon Nov. 2, 2023, 5:33 p.m. UTC | #1
On 12:05-20231101, Andrew Davis wrote:
> This allows us to use some of the normal preprocessor directives inside
> defconfig files. Such as #define and #include.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Nishanth Menon <nm@ti.com>
diff mbox series

Patch

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 2d97aab8d21..5ce5845e824 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -93,7 +93,8 @@  endif
 endif
 
 %_defconfig: $(obj)/conf
-	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
+	$(Q)$(CPP) -nostdinc -I $(srctree) -undef -x assembler-with-cpp $(srctree)/arch/$(SRCARCH)/configs/$@ -o generated_defconfig
+	$(Q)$< $(silent) --defconfig=generated_defconfig $(Kconfig)
 
 # Added for U-Boot (backward compatibility)
 %_config: %_defconfig