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

Mike Frysinger vapier.adi at gmail.com
Thu Jul 7 16:48:03 EDT 2011


On Thu, Jul 7, 2011 at 16:44, Brian Norris wrote:
> When using "make CROSS=mipsel-linux-", I get the following errors:
>
> /bin/sh: /home/norris/git/mtd-utils/mipsel-linux/include/version.h.tmp: No such file or directory
> make: *** [/home/norris/git/mtd-utils/mipsel-linux/include/version.h.tmp] Error 1
>
> So instead of "building" our version.h within $(BUILDIR), we should
> just build it in the main source directory, as it isn't architecture-
> specific or anything. Hopefully that doesn't "break the rules" of our
> cross-compilation setup...

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".

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



More information about the linux-mtd mailing list