Makefile: Improve generated_defconfig file handling
PATCH 1/1 Makefile: Improve generated_defconfig file handling
Commit 2027e99e61aa ("Makefile: Run defconfig files through the C preprocessor") adds generated_defconfig' file, but fails to clean that up. It might be useful to have that file around after make' is done, but it's better to clean that up on make clean'. Also we probably want to hide it in git status' list. This patch makes the described changes, and also adds -P' parameter to the CPP command that produces the generated_defconfig' to avoid generating linemarkers.
--- .gitignore | 1 + Makefile | 1 + scripts/kconfig/Makefile | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
.gitignore +1 -0
@@ -63,6 +63,7 @@ fit-dtb.blob* /spl/ /tpl/ /defconfig +/generated_defconfig # # Generated include files
Makefile +1 -0
@@ -2205,6 +2205,7 @@ clean: $(clean-dirs) -o -name modules.builtin -o -name '.tmp_*.o.*' \ -o -name 'dsdt_generated.aml' -o -name 'dsdt_generated.asl.tmp' \ -o -name 'dsdt_generated.c' \ + -o -name 'generated_defconfig' \ -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \ -type f -print | xargs rm -f
scripts/kconfig/Makefile +1 -1
@@ -93,7 +93,7 @@ endif endif %_defconfig: $(obj)/conf - $(Q)$(CPP) -nostdinc -I $(srctree) -undef -x assembler-with-cpp $(srctree)/arch/$(SRCARCH)/configs/$@ -o generated_defconfig + $(Q)$(CPP) -nostdinc -P -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)
Signature · 1 line
2.39.2
Quoted 8 lines · Sam Protsenko
Commit
2027e99e61aa("Makefile: Run defconfig files through the C preprocessor") addsgenerated_defconfig' file, but fails to clean that up. It might be useful to have that file around aftermake' is done, but it's better to clean that up onmake clean'. Also we probably want to hide it ingit status' list. This patch makes the described changes, and also adds-P' parameter to the CPP command that produces thegenerated_defconfig' to avoid generating linemarkers.
All look like sensible improvements to me,
Quoted 45 lines
Signed-off-by Sam Protsenko <[email protected]>Fixes 2027e99e61aa ("Makefile: Run defconfig files through the C preprocessor")--- .gitignore | 1 + Makefile | 1 + scripts/kconfig/Makefile | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-).gitignore +1
-0@@ -63,6 +63,7 @@ fit-dtb.blob* /spl/ /tpl/ /defconfig +/generated_defconfig # # Generated include filesMakefile +1
-0@@ -2205,6 +2205,7 @@ clean: $(clean-dirs) -o -name modules.builtin -o -name '.tmp_*.o.*' \ -o -name 'dsdt_generated.aml' -o -name 'dsdt_generated.asl.tmp' \ -o -name 'dsdt_generated.c' \ + -o -name 'generated_defconfig' \ -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \ -type f -print | xargs rm -fscripts/kconfig/Makefile +1
-1@@ -93,7 +93,7 @@ endif endif %_defconfig: $(obj)/conf - $(Q)$(CPP) -nostdinc -I $(srctree) -undef -x assembler-with-cpp $(srctree)/arch/$(SRCARCH)/configs/$@ -o generated_defconfig + $(Q)$(CPP) -nostdinc -P -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)
Quoted 11 lines · Sam Protsenko
Commit
2027e99e61aa("Makefile: Run defconfig files through the C preprocessor") addsgenerated_defconfig' file, but fails to clean that up. It might be useful to have that file around aftermake' is done, but it's better to clean that up onmake clean'. Also we probably want to hide it ingit status' list. This patch makes the described changes, and also adds-P' parameter to the CPP command that produces thegenerated_defconfig' to avoid generating linemarkers.Signed-off-by Sam Protsenko <[email protected]>Fixes 2027e99e61aa ("Makefile: Run defconfig files through the C preprocessor")Acked-by Andrew Davis <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom