RegressionTests__MakefileTests.st
branchjv
changeset 1474 54b7f76f0e68
parent 1148 341a95374920
child 1479 974a26a06296
--- a/RegressionTests__MakefileTests.st	Sat Dec 05 10:28:00 2015 +0000
+++ b/RegressionTests__MakefileTests.st	Mon Dec 21 15:21:43 2015 +0000
@@ -46,15 +46,40 @@
 make: target
     | cmd |
 
-    cmd := OperatingSystem isMSWINDOWSlike 
-            ifTrue:['bmake.bat ', target]
-            ifFalse:['make -f Makefile.init ', target].
+    OperatingSystem isMSWINDOWSlike ifTrue:[ 
+        OperatingSystem getCCDefine = '__BORLANDC__' ifTrue:[ 
+            cmd := 'bmake.bat ' , target.
+        ].
+        OperatingSystem getCCDefine = '__MINGW32__' ifTrue:[ 
+            (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ 
+                self assert: 'C:\MINGW' asFilename exists description: 'MINGW_DIR environment variable not set and C:\MINGW does not exist'.
+                OperatingSystem setEnvironment: 'MINGW_DIR'     to: 'C:\MINGW'.
+            ].
+            OperatingSystem setEnvironment: 'MINGW'         to: '__MINGW32__'.
+            OperatingSystem setEnvironment: 'USEMINGW_ARG'  to: '-DUSEMINGW32'.
+            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';C:\MINGW\bin'.
+            cmd := 'mingwmake.bat ' , target.
+        ].
+        OperatingSystem getCCDefine = '__MINGW64__' ifTrue:[ 
+            (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ 
+                self assert: 'C:\MINGW64' asFilename exists description: 'MINGW_DIR environment variable not set and C:\MINGW does not exist'.
+                OperatingSystem setEnvironment: 'MINGW_DIR'     to: 'C:\MINGW64'.
+            ].
+            OperatingSystem setEnvironment: 'MINGW'         to: '__MINGW64__'.
+            OperatingSystem setEnvironment: 'USEMINGW_ARG'  to: '-DUSEMINGW64'.
+            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';C:\MINGW64\bin'.
+            cmd := 'mingwmake.bat ' , target.
+        ].
+    ] ifFalse:[
+        cmd := 'make -f Makefile.init ', target
+    ].
     self 
         assert: (OperatingSystem executeCommand: cmd inDirectory: packageDir)
         description: 'Failed to make target ''', target, ''' in test package'.
 
     "Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 19-11-2013 / 18:49:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-12-2015 / 14:45:20 / jv"
 ! !
 
 !MakefileTests methodsFor:'running'!
@@ -210,5 +235,10 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !