Build Hadrian in /hadrian/bin
authorAndrey Mokhov <andrey.mokhov@gmail.com>
Sun, 23 Oct 2016 18:06:09 +0000 (19:06 +0100)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Sun, 23 Oct 2016 18:06:09 +0000 (19:06 +0100)
.gitignore
build.bat
build.sh

index 87bedb8..6b06fea 100644 (file)
@@ -2,8 +2,7 @@
 cfg/system.config
 
 # build.bat and build.sh specific
-/hadrian
-/hadrian.exe
+/bin/
 
 # build.cabal.sh specific
 /dist/
index 6e86d42..2bc9a95 100644 (file)
--- a/build.bat
+++ b/build.bat
@@ -1,31 +1,31 @@
-@cd %~dp0\r
-@mkdir ../_build/hadrian 2> nul\r
-\r
-@set ghcArgs=--make                       ^\r
-             -Wall                        ^\r
-             -fno-warn-name-shadowing     ^\r
-             -XRecordWildCards            ^\r
-             src/Main.hs                  ^\r
-             -threaded                    ^\r
-             -isrc                        ^\r
-             -rtsopts                     ^\r
-             -with-rtsopts=-I0            ^\r
-             -outputdir=../_build/hadrian ^\r
-             -i../libraries/Cabal/Cabal   ^\r
-             -j                           ^\r
-             -O                           ^\r
-             -o hadrian\r
-\r
-@set hadrianArgs=--lint      ^\r
-                 --directory ^\r
-                 ".."        ^\r
-                 %*\r
-\r
-\r
-@ghc %ghcArgs%\r
-\r
-@if %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%\r
-\r
-@rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains\r
-@set GHC_PACKAGE_PATH=\r
-@hadrian %hadrianArgs%\r
+@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%
index d627c58..0f957cf 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -39,7 +39,7 @@ if type cabal > /dev/null 2>&1; then
     fi
 fi
 
-mkdir -p "$root/../_build/hadrian"
+mkdir -p "$root/bin"
 
 ghc                                      \
     "$root/src/Main.hs"                  \
@@ -51,11 +51,11 @@ ghc                                      \
     -rtsopts                             \
     -with-rtsopts=-I0                    \
     -threaded                            \
-    -outputdir="$root/../_build/hadrian" \
+    -outputdir="$root/bin" \
     -j -O                                \
-    -o "$root/hadrian"
+    -o "$root/bin/hadrian"
 
-"$root/hadrian"            \
+"$root/bin/hadrian"        \
     --lint                 \
     --directory "$root/.." \
     "$@"