Commit efb2172ece93ef48f34fb8bdf963d3b72880cc7d

Authored by Simon Glass
Committed by Wolfgang Denk
1 parent 86eb49b3e5

Move timestamp and version files into 'generated' subdir

There is a rather subtle build problem where the build time stamp is not
updated for out-of-tree builds if there exists an in-tree build which
has a valid timestamp file. So if you do an in-tree build, then an
out-of-tree build your timestamp will not change.

The correct timestamp_autogenerated.h lives in the object tree, but it
is not always found there. The source still lives in the source tree and
when compiling version.h, it includes timestamp_autogenerated.h. Since
the current directory is always searched first, this will come from the
source tree rather than the object tree if it exists there. This affects
dependency generation also, which means that common/cmd_version.o will not
even be rebuilt if you have ever done an in-tree build.

A similar problem exists with the version file.

This change moves both files into the 'generated' subdir, which is already
used for asm-offsets.h. Then timestamp.h and version.h are updated to
include the files from there.

There are other places where these generated files are included, but I
cannot see why these don't just use the timestamp.h and version.h headers.
So this change also tidies that up.

I have tested this with in- and out-of-tree builds, but not SPL. I have
looked at various other options for fixing this, including sed on the dep
files, -I- and -include flags to gcc, but I don't think they can be made
to work. Comments welcome.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>

Showing 8 changed files with 8 additions and 13 deletions Side-by-side Diff

... ... @@ -30,8 +30,8 @@
30 30 else
31 31 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
32 32 endif
33   -TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
34   -VERSION_FILE = $(obj)include/version_autogenerated.h
  33 +TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h
  34 +VERSION_FILE = $(obj)include/generated/version_autogenerated.h
35 35  
36 36 HOSTARCH := $(shell uname -m | \
37 37 sed -e s/i.86/x86/ \
arch/arm/cpu/armv7/omap-common/spl.c
... ... @@ -29,8 +29,7 @@
29 29 #include <nand.h>
30 30 #include <mmc.h>
31 31 #include <fat.h>
32   -#include <timestamp_autogenerated.h>
33   -#include <version_autogenerated.h>
  32 +#include <version.h>
34 33 #include <asm/omap_common.h>
35 34 #include <asm/arch/mmc_host_def.h>
36 35 #include <i2c.h>
arch/arm/cpu/armv7/omap-common/spl_mmc.c
... ... @@ -28,8 +28,7 @@
28 28 #include <asm/arch/sys_proto.h>
29 29 #include <mmc.h>
30 30 #include <fat.h>
31   -#include <timestamp_autogenerated.h>
32   -#include <version_autogenerated.h>
  31 +#include <version.h>
33 32 #include <asm/omap_common.h>
34 33 #include <asm/arch/mmc_host_def.h>
35 34  
arch/arm/cpu/armv7/omap-common/spl_nand.c
... ... @@ -25,8 +25,7 @@
25 25 #include <asm/utils.h>
26 26 #include <asm/arch/sys_proto.h>
27 27 #include <nand.h>
28   -#include <timestamp_autogenerated.h>
29   -#include <version_autogenerated.h>
  28 +#include <version.h>
30 29 #include <asm/omap_common.h>
31 30  
32 31  
drivers/serial/usbtty.h
... ... @@ -37,7 +37,7 @@
37 37 #include <usb/spr_udc.h>
38 38 #endif
39 39  
40   -#include <version_autogenerated.h>
  40 +#include <version.h>
41 41  
42 42 /* If no VendorID/ProductID is defined in config.h, pretend to be Linux
43 43 * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
... ... @@ -3,6 +3,4 @@
3 3 /bmp_logo.h
4 4 /config.h
5 5 /config.mk
6   -/timestamp_autogenerated.h
7   -/version_autogenerated.h
... ... @@ -24,7 +24,7 @@
24 24 #define __TIMESTAMP_H__
25 25  
26 26 #ifndef DO_DEPS_ONLY
27   -#include "timestamp_autogenerated.h"
  27 +#include "generated/timestamp_autogenerated.h"
28 28 #endif
29 29  
30 30 #endif /* __TIMESTAMP_H__ */
... ... @@ -27,7 +27,7 @@
27 27 #include <timestamp.h>
28 28  
29 29 #ifndef DO_DEPS_ONLY
30   -#include "version_autogenerated.h"
  30 +#include "generated/version_autogenerated.h"
31 31 #endif
32 32  
33 33 #ifndef CONFIG_IDENT_STRING