[Buildroot] [PATCH 1/1] Declare SED Makefile instead of package/Makefile.in so it exists globally.

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Feb 17 08:47:15 UTC 2016


Hello,

On Wed, 17 Feb 2016 09:22:48 +0100, Alvaro Gamez wrote:

> Well, I've been reviewing the original thread (
> http://lists.busybox.net/pipermail/buildroot/2015-June/130347.html) in
> order to write a good commit and I've just realized that this patch wasn't
> in fact written by me, it was written by Thomas in respones to my
> inquiries, so I think the Signed-off-by line should in fact belong to him,
> not me. Sorry I took over that, it wasn't my intention.

Aaah, yes, now I remember.

The savedefconfig target looks like:

savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
        @$(COMMON_CONFIG_ENV) $< \
                --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
                $(CONFIG_CONFIG_IN)
        @$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)

So it uses the $(SED) variable.

However, this savedefconfig targets is implemented *outside* of the
ifeq ($(BR2_HAVE_DOT_CONFIG),y) condition, but the inclusion of
package/Makefile.in (which defines the SED variable) is only done
inside the ifeq ($(BR2_HAVE_DOT_CONFIG),y).

So when you start from scratch and do "make menuconfig savedefconfig",
BR2_HAVE_DOT_CONFIG is not defined, so package/Makefile.in is not
included.

Define SED in the main Makefile is a quick work-around.

However, it will only fix this specific problem, and I believe if you do:

	make menuconfig savedefconfig all

With the aim of starting the build right after the menuconfig, then it
will still not work for other reasons.

I see two possible directions here:

 1. We decide to really separate targets that can "create" the
    configuration from the other targets, and in this case, savedefconfig
    should be defined inside the BR2_HAVE_DOT_CONFIG condition. Which
    means that "make menuconfig savedefconfig" would no longer work,
    and you would have to do "make menuconfig" and then "make
    savedefconfig".

 2. We decide that all targets should be available at all times, and
    get rid of this BR2_HAVE_DOT_CONFIG. However, I don't see how this
    can work since if you do "make menuconfig all", then at the time of
    "menuconfig", the .config doesn't exist, so it cannot be included
    by the main Makefile, and therefore when the "all" target will be
    processed, we won't have all the BR2_* make variables defined.

So I believe (2) doesn't work, and we should instead go with (1).

Arnout, what do you think?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list