[Buildroot] *Tons* of BR warnings like "package/Makefile.autotools.in:179: warning: overriding commands for target `/home/bjornfor/raid/forks/buildroot/output'"

Bjørn Forsman bjorn.forsman at gmail.com
Sun Dec 13 20:51:35 UTC 2009


2009/12/11 Peter Korsgaard <jacmet at uclibc.org>:
>>>>>> "Bjørn" == Bjørn Forsman <bjorn.forsman at gmail.com> writes:
>  Bjørn> and when building a non-working configuration, there is no other
>  Bjørn> output than the warnings and then full stop. Make quits before
>  Bjørn> running the 'test' target! See the log:
>
> Ahh yes, you never get that far with those warnings.
>
> I think your BASE_DIR and/or BUILD_DIR variables somehow gets an extra
> space appended/prepended.
>
> Could you change the BASE_DIR := line in the toplevel makefile to simply
> read:
>
> BASE_DIR:=home/bjornfor/dev/buildroot/output
>
> and try again?

I finally found the bug. (Thanks a lot for the hint, Peter.) BASE_DIR ends
up containing the Buildroot output directory *two* times (separated by a
space). And it happends because I use the CDPATH environment variable.

Let me demonstrate:

$ mkdir dir
$ (CDPATH= cd dir/)      # no output
$ (CDPATH=.:.. cd dir/)  # output!
/tmp/directory/dir

This means that when the top Makefile in BR says:

  BASE_DIR := $(shell mkdir -p $(O) && cd $(O) && pwd)

both 'cd' and 'pwd' will print out the same path (when CDPATH is
non-empty), BASE_DIR will be containing two identical paths. Make freaks
out and BR fails.

So to fix this issue I thought it would be easy to remove CDPATH from
the Buildroot environment. But how? I tried:

export CDPATH:=
unexport CDPATH

in the top Makefile but neither worked.

It is also possible to use absolute paths when defining BASE_DIR. But I
don't know how to do that when the output variable O can be relative or
absolute:

  $ make O=/tmp/output
  $ make O=output

Any suggestions?

Best regards,
Bjørn Forsman


More information about the buildroot mailing list