Make build.bat call the default build script on Windows (build.stack.bat)
authorAndrey Mokhov <andrey.mokhov@gmail.com>
Mon, 23 Oct 2017 20:36:37 +0000 (21:36 +0100)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Mon, 23 Oct 2017 20:36:37 +0000 (21:36 +0100)
See #428.

Note that building Hadrian with Cabal currently fails on Windows, hence using Stack.

Also see #440: build.bat may later be relocated to the top of the GHC tree.

build.bat
build.global-db.bat [new file with mode: 0644]

index 722f3d7..18cf6cb 100644 (file)
--- a/build.bat
+++ b/build.bat
@@ -1,33 +1,4 @@
 @echo off
-setlocal
-cd %~dp0
-mkdir bin 2> nul
 
-set ghcArgs=--make                     ^
-            -Wall                      ^
-            -fno-warn-name-shadowing   ^
-            -XRecordWildCards          ^
-            src\Main.hs                ^
-            -threaded                  ^
-            -isrc                      ^
-            -i..\libraries\Cabal\Cabal ^
-            -rtsopts                   ^
-            -with-rtsopts=-I0          ^
-            -outputdir=bin             ^
-            -j                         ^
-            -O                         ^
-            -o bin\hadrian
-
-set hadrianArgs=--lint      ^
-                --directory ^
-                ".."        ^
-                %*
-
-
-ghc %ghcArgs%
-
-if %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
-
-rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains
-set GHC_PACKAGE_PATH=
-bin\hadrian %hadrianArgs%
+rem By default on Windows we build Hadrian using Stack
+./build.stack.bat %*
diff --git a/build.global-db.bat b/build.global-db.bat
new file mode 100644 (file)
index 0000000..0d6a696
--- /dev/null
@@ -0,0 +1,32 @@
+@echo off
+setlocal
+cd %~dp0
+mkdir bin 2> nul
+
+set ghcArgs=--make                     ^
+            -Wall                      ^
+            -fno-warn-name-shadowing   ^
+            -XRecordWildCards          ^
+            src\Main.hs                ^
+            -threaded                  ^
+            -isrc                      ^
+            -i..\libraries\Cabal\Cabal ^
+            -rtsopts                   ^
+            -with-rtsopts=-I0          ^
+            -outputdir=bin             ^
+            -j                         ^
+            -O                         ^
+            -o bin\hadrian
+
+set hadrianArgs=--lint      ^
+                --directory ^
+                ".."        ^
+                %*
+
+ghc %ghcArgs%
+
+if %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
+
+rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains
+set GHC_PACKAGE_PATH=
+bin\hadrian %hadrianArgs%