path: root/include
diff options
authorSimon Glass <>2011-10-10 08:55:19 +0000
committerWolfgang Denk <>2011-10-17 23:57:00 +0200
commitefb2172ece93ef48f34fb8bdf963d3b72880cc7d (patch)
tree41e8af266f4aa9ff43ea5f47b3e318c049f65ff2 /include
parent86eb49b3e596baa688bea5ef678e951e964845a3 (diff)
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 <> Acked-by: Mike Frysinger <>
Diffstat (limited to 'include')
3 files changed, 2 insertions, 4 deletions
diff --git a/include/.gitignore b/include/.gitignore
index 77594e53ff..ec224c545c 100644
--- a/include/.gitignore
+++ b/include/.gitignore
@@ -3,5 +3,3 @@
diff --git a/include/timestamp.h b/include/timestamp.h
index b2f4cf4d7b..05a6658573 100644
--- a/include/timestamp.h
+++ b/include/timestamp.h
@@ -24,7 +24,7 @@
#define __TIMESTAMP_H__
#ifndef DO_DEPS_ONLY
-#include "timestamp_autogenerated.h"
+#include "generated/timestamp_autogenerated.h"
#endif /* __TIMESTAMP_H__ */
diff --git a/include/version.h b/include/version.h
index 129acef0b8..c908bd3013 100644
--- a/include/version.h
+++ b/include/version.h
@@ -27,7 +27,7 @@
#include <timestamp.h>
#ifndef DO_DEPS_ONLY
-#include "version_autogenerated.h"
+#include "generated/version_autogenerated.h"
OpenPOWER on IntegriCloud