Skip to contentSkip to conversation

Makefile: defconfig: use BR2_DEFCONFIG only when the file exists

PATCH New Fabio Porcedda 3 participants 4 messages May 30, 2013 – Dec 26, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: defconfig: use BR2_DEFCONFIG only when the file exists

This is to be able to use "make defconfig" even when BR2_DEFCONFIG has a filename that does not exist or use the default value that does not exists.

Example on a clean installation, without a "./defconfig":
make defconfig
make defconfig

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e8647d1..57bf8b3 100644
@@ -698,7 +698,7 @@ olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(wildcard $(DEFCONFIG)),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
 
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 Makefile: defconfig: use BR2_DEFCONFIG only when the file exists

Dear Fabio Porcedda,

Quoted 7 lines · Fabio Porcedda

This is to be able to use "make defconfig" even when BR2_DEFCONFIG has a filename that does not exist or use the default value that does not exists.

Example on a clean installation, without a "./defconfig":
make defconfig
make defconfig

I'm not sure to understand the example here. Could you detail a little bit?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 Makefile: defconfig: use BR2_DEFCONFIG only when the file exists

Quoted 7 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Quoted 4 lines · Fabio Porcedda

This is to be able to use "make defconfig" even when BR2_DEFCONFIG has a filename that does not exist or use the default value that does not exists.

Quoted 6 lines
Quoted 3 lines

Example on a clean installation, without a "./defconfig":
make defconfig
make defconfig

I'm not sure to understand the example here. Could you detail a little bit?

Without this patch the first "make defconfig" works, but the second "make defconfig" fails.
With this patch the second "make defconfig" works like the first one.

This is because when the first "make defconfig" is issued the BR2_DEFCONFIG is empty, instead when the second "make defconfig" is issued the BR2_DEFCONFIG has the default value "$(CONFIG_DIR)/defconfig" that usually does not exists and so fails.

I fixed this failure ignoring the BR2_DEFCONFIG when the default value does not exist.

Best regards
--
Fabio Porcedda

#3 lore raw

PATCH 1/1 Makefile: defconfig: use BR2_DEFCONFIG only when the file exists

Fabio, Thomas, All,

On 2013-05-30 16:25 +0200, Fabio Porcedda spake thusly:

Quoted 13 lines
Quoted 11 lines · Thomas Petazzoni

Dear Fabio Porcedda,

Quoted 7 lines · Fabio Porcedda

This is to be able to use "make defconfig" even when BR2_DEFCONFIG has a filename that does not exist or use the default value that does not exists.

Example on a clean installation, without a "./defconfig":
make defconfig
make defconfig

Quoted 6 lines
Quoted 2 lines

I'm not sure to understand the example here. Could you detail a little bit?

Without this patch the first "make defconfig" works, but the second "make defconfig" fails.
With this patch the second "make defconfig" works like the first one.

I think I have a better fix for this:

    http://patchwork.ozlabs.org/patch/305312/

So I'm marking your patch as superseded.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'