Ensure that if ghc compilation fails then we return a non-zero error code from build.bat
[hadrian.git] / build.bat
1 @cd %~dp0
2 @mkdir .shake 2> nul
3
4 @set ghcArgs=--make ^
5 -Wall ^
6 -fno-warn-name-shadowing ^
7 src/Main.hs ^
8 -isrc ^
9 -rtsopts ^
10 -with-rtsopts=-I0 ^
11 -outputdir=.shake ^
12 -j ^
13 -O ^
14 -o .shake/build
15
16 @set shakeArgs=--lint ^
17 --directory ^
18 ".." ^
19 %*
20
21
22 @ghc %ghcArgs%
23
24 @if %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
25
26 @rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains
27 @set GHC_PACKAGE_PATH=
28 @.shake\build %shakeArgs%