From e20c1ac61fcbfa35957a8c32d8e855a3af3f27eb Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Tue, 5 Jul 2016 10:24:08 +0100
Subject: [PATCH] wmakeCollect: Support simultaneous builds of different target
 architectures or compilers

---
 wmake/wmake        | 15 ++++++++-------
 wmake/wmakeCollect |  7 ++++---
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/wmake/wmake b/wmake/wmake
index a047b12c2c..08f62e1375 100755
--- a/wmake/wmake
+++ b/wmake/wmake
@@ -347,13 +347,14 @@ scheduler="wmakeCollect"
 
 if [ "$all" = "queue" ]
 then
-    (                                             \
-        wmakeLnIncludeAll -j$WM_NCOMPPROCS        \
-     && WM_ID=$(stat --format=%d.%i $PWD)         \
-        WM_SCHEDULER=$scheduler                   \
-        trap '$scheduler -kill' TERM INT;         \
-        wmake -all objects                        \
-     && $scheduler                                \
+    (                                                 \
+        wmakeLnIncludeAll -j$WM_NCOMPPROCS            \
+     && WM_ID=${PWD////_}.$WM_OPTIONS                 \
+        WM_SCHEDULER=$scheduler                       \
+        trap '$scheduler -kill' TERM INT;             \
+        $scheduler -clean                             \
+     && wmake -all objects                            \
+     && $scheduler                                    \
     ) && wmake -all
     exit $?
 fi
diff --git a/wmake/wmakeCollect b/wmake/wmakeCollect
index cace7450d4..c0435e4af5 100755
--- a/wmake/wmakeCollect
+++ b/wmake/wmakeCollect
@@ -42,7 +42,8 @@ usage() {
 Usage: $Script [OPTION] <command>
 
 options:
-  -kill             Removes temporary makefiles
+  -clean            Clean-up before compilation (removes old makefiles)
+  -kill             Clean-up after termination (removes makefiles)
   -h | -help        Print the usage
 
 Collecting scheduler for fast parallel compilation of large numbers of object
@@ -76,7 +77,7 @@ do
     -h | -help)
         usage
         ;;
-    -kill)
+    -kill | -clean)
         cleanup="true"
         shift
         ;;
@@ -135,7 +136,7 @@ then
 
     # Add the build rule for the current target
     echo "$object: $makefile" >> $file
-    echo -e "\t cd $PWD && \\" >> $file
+    echo -e "\tcd $PWD && \\" >> $file
     echo -e "\t${@:1:($#-1)} $object" >> $file
     echo >> $file
 else
-- 
GitLab