Skip to contentSkip to conversation

Makefile: Handle building in a very old build directory

PATCH New Simon Glass 2 participants 2 messages May 7, 2021 – May 18, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Handle building in a very old build directory

Versions of U-Boot before 2014.01 created a symlink from include/asm to the architecture-specific header directory.

If an ARM board is build with that old version, then sandbox is built on a more recent version (both with in-tree builds), the include/asm symlink confuses the build system. It picks up the ARM headers when it should be using the sandbox ones.

Since 2014 U-Boot has only created a symlink inside the include/asm/ directory and only for out-of-tree builds. So for in-tree builds it does not expect to see an include/asm symlink. It is not removed by 'make mrproper'. It does show up with 'git status' but is easy enough to miss.

Add include/asm to the files to remove with 'make mkproper'. For recent U-Boot builds this has no effect, since include/asm is a directory, not a file. If the include/asm symlink is there, it will be removed.

---

 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Makefile +3 -1
index ebbedb1fb1a..9f4b226a5c5 100644
@@ -2043,9 +2043,11 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
 		  .tmp_objdiff doc/output
+
+# Remove include/asm symlink created by U-Boot before v2014.01
 MRPROPER_FILES += .config .config.old include/autoconf.mk* include/config.h \
 		  ctags etags tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
-		  drivers/video/fonts/*.S
+		  drivers/video/fonts/*.S include/asm
 
 # clean - Delete most, but leave enough to build external modules
 #
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#1 lore raw

PATCH 1/1 Makefile: Handle building in a very old build directory

Quoted 14 lines · Simon Glass

Versions of U-Boot before 2014.01 created a symlink from include/asm to the architecture-specific header directory.

If an ARM board is build with that old version, then sandbox is built on a more recent version (both with in-tree builds), the include/asm symlink confuses the build system. It picks up the ARM headers when it should be using the sandbox ones.

Since 2014 U-Boot has only created a symlink inside the include/asm/ directory and only for out-of-tree builds. So for in-tree builds it does not expect to see an include/asm symlink. It is not removed by 'make mrproper'. It does show up with 'git status' but is easy enough to miss.

Quoted 6 lines

Add include/asm to the files to remove with 'make mkproper'. For recent U-Boot builds this has no effect, since include/asm is a directory, not a file. If the include/asm symlink is there, it will be removed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210518/2b6ba651/attachment.sig>