From 5b28e12ad3f3d7fa7dc285af3f60624f4a907003 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Sat, 9 Jul 2016 14:20:31 +0100
Subject: [PATCH] wmakeCollect: Use 'mktemp' to create the temporary Makefiles
 to avoid file names which are two long for the standard GNU/Linux file
 systems.

---
 wmake/wmakeCollect | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wmake/wmakeCollect b/wmake/wmakeCollect
index 5f9c095f78c..4f1ca4bf4f9 100755
--- a/wmake/wmakeCollect
+++ b/wmake/wmakeCollect
@@ -121,7 +121,7 @@ then
     object="${@: -1:1}"
 
     # Create a unique name for the makefile from the object path
-    file=$WM_COLLECT_DIR/${object////_}
+    file=$(mktemp $WM_COLLECT_DIR/XXXXXX)
 
     # Add the current target to the list of objects
     echo "OBJECTS += $object" >> $file
@@ -135,7 +135,7 @@ else
     if [ -d $WM_COLLECT_DIR ]
     then
         # Collect all the makefiles into a single makefiles for this build
-        cat $WM_COLLECT_DIR/* > $makefile
+        (cd $WM_COLLECT_DIR && ls -1rt | xargs cat > $makefile)
 
         # Add a build rule for all of the targets
         echo 'all: $(OBJECTS)' >> $makefile
-- 
GitLab