[PATCH 1/3] Makefile: fix "version.h" build for cross-compiling

Brian Norris computersforpeace at gmail.com
Thu Jul 7 17:09:37 EDT 2011


On Thu, Jul 7, 2011 at 1:48 PM, Mike Frysinger <vapier.adi at gmail.com> wrote:
> i dont think it's just a matter of "diff build dir for diff
> toolchains, so common version.h is ok".  it's a matter of "building
> out of tree should build out of tree".

OK, but what is the point of in- vs. out-of-tree? So that we can have
a readonly source directory where the mtd-utils code stays? Or so that
we keep object files away from code? Or some other reason?

> i think the fix to your problem is:
>  $(BUILDDIR)/include/version.h.tmp
> +    $(Q)mkdir -p $(dir $@)
>       $(Q)echo '#define VERSION "$(VERSION)"' > $@

Except that gives this error:
  CC      ftl_format.o
  CC      lib/libmtd.o
In file included from lib/libmtd.c:40:0:
./include/common.h:28:21: fatal error: version.h: No such file or directory
compilation terminated.
make: *** [/home/norris/git/mtd-utils/mipsel-linux/lib/libmtd.o] Error 1

Really, the build system is setup to look for headers in-tree, not
out-of-tree. I'm not sure a good way to fix this other than to
generate that header in-tree...any better suggestions?

Brian



More information about the linux-mtd mailing list