Skip to contentSkip to conversation

Main Makefile Have "make savedefconfig" show where the file is being written to.

PATCH New Christopher McCrory 4 participants 6 messages Feb 27, 2018 – Mar 2, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Main Makefile Have "make savedefconfig" show where the file is being written to.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index ec39bcdb9c..4ac2435a9c 100644
@@ -927,6 +927,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 		$(CONFIG_CONFIG_IN)
 	@$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
+	@echo "Saved to $(DEFCONFIG)"
 
 .PHONY: defconfig savedefconfig
 
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 Main Makefile Have "make savedefconfig" show where the file is being written to.

Hello,

Quoted 1 line · Christopher McCrory

The commit title should be shorter, perhaps:

Makefile: show defconfig file being saved in 'savedefconfig'

and then the commit log should expand on that, to explain why this is useful.

Makefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig · line 930

Quoted 13 lines
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index ec39bcdb9c..4ac2435a9c 100644
@@ -927,6 +927,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 		$(CONFIG_CONFIG_IN)
 	@$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
+	@echo "Saved to $(DEFCONFIG)"

I'm personally OK with this, and believe it makes sense. I've always found it weird that we automatically save back to the defconfig we have started from, but some people liked that. More than once I've been puzzled after a "make savedefconfig" to not find a "defconfig" file in the current folder, because the defconfig had been updated in configs/<something>_defconfig. So to me, your change makes sense.

Could you respin after fixing the commit title, and expanding a bit the commit log ?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#2 lore raw

PATCH 1/1 Main Makefile Have "make savedefconfig" show where the file is being written to.

In reply to Christopher McCrory
Quoted 10 lines · Christopher McCrory
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index ec39bcdb9c..4ac2435a9c 100644

Makefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig · line 930

Quoted 4 lines
Makefile +1 -0
@@ -927,6 +927,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 		$(CONFIG_CONFIG_IN)
 	@$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
+	@echo "Saved to $(DEFCONFIG)"

If BR2_DEFCONFIG is not set, you'll get "Saved to " which is a bit weird. So
change into:

	@echo "Saved to $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)"

But now $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) is used 3
times, so perhaps it's worth adding a variable for it. I can't think of a good name for it unfortunately.

Regards,
Arnout

Quoted 4 lines
Makefile +0 -0
 .PHONY: defconfig savedefconfig
 
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 Main Makefile Have "make savedefconfig" show where the file is being written to.

Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 10 lines · Christopher McCrory

---
Makefile | 1 +

1 file changed, 1 insertion(+)
Makefile +0 -0
index ec39bcdb9c..4ac2435a9c 100644

Makefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig · line 929

Quoted 4 lines
Makefile +1 -1
@@ -927,6 +927,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 $(CONFIG_CONFIG_IN)
 @$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
+	@echo "Saved to $(DEFCONFIG)"

If BR2_DEFCONFIG is not set, you'll get "Saved to " which is a bit weird. So
change into:

Quoted 5 lines
	@echo "Saved to $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)"

But now $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) is used 3
times, so perhaps it's worth adding a variable for it. I can't think of a good name for it unfortunately.

Perhaps we could just set DEFCONFIG to $(CONFIG_DIR)/defconfig if empty?

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 Main Makefile Have "make savedefconfig" show where the file is being written to.

Quoted 21 lines · Peter Korsgaard
Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 10 lines · Christopher McCrory

---
Makefile | 1 +

1 file changed, 1 insertion(+)
Makefile +0 -0
index ec39bcdb9c..4ac2435a9c 100644

Makefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig · line 929

Quoted 4 lines
Makefile +1 -1
@@ -927,6 +927,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
 $(CONFIG_CONFIG_IN)
 @$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
+	@echo "Saved to $(DEFCONFIG)"

If BR2_DEFCONFIG is not set, you'll get "Saved to " which is a bit weird. So
change into:

Quoted 7 lines
Quoted 5 lines
	@echo "Saved to $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)"

But now $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) is used 3
times, so perhaps it's worth adding a variable for it. I can't think of a good name for it unfortunately.

Perhaps we could just set DEFCONFIG to $(CONFIG_DIR)/defconfig if empty?

I looked at that, but in the 'make defconfig' rule we have to be able to
distinguish between BR2_DEFCONFIG is set or not. Since BR2_DEFCONFIG may come out of the .config file, it may or may not be quoted. That's why we need to use the qstrip'ed version DEFCONFIG in the condition.

This stuff is complicated :-) It's one of these examples where, when I started
adding the feature, I thought "this is trivial" but then the real world kicks in.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH 1/1 Main Makefile Have "make savedefconfig" show where the file is being written to.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Perhaps we could just set DEFCONFIG to $(CONFIG_DIR)/defconfig if empty?

I looked at that, but in the 'make defconfig' rule we have to be able to
distinguish between BR2_DEFCONFIG is set or not. Since BR2_DEFCONFIG may come out of the .config file, it may or may not be quoted. That's why we need to use the qstrip'ed version DEFCONFIG in the condition.

Ahh yes.

Quoted 2 lines

This stuff is complicated :-) It's one of these examples where, when I started
adding the feature, I thought "this is trivial" but then the real world kicks in.

I know the feeling ;)

Signature · 1 line
Bye, Peter Korsgaard