Commit 1317c886 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Build Hadrian in _build.

parent 57791057
@cd %~dp0
@mkdir .shake 2> nul
@mkdir ../_build 2> nul
@set ghcArgs=--make ^
-Wall ^
-fno-warn-name-shadowing ^
-XRecordWildCards ^
src/Main.hs ^
-threaded ^
-isrc ^
-rtsopts ^
-with-rtsopts=-I0 ^
-outputdir=.shake ^
-j ^
-O ^
-o .shake/build
@set ghcArgs=--make ^
-Wall ^
-fno-warn-name-shadowing ^
-XRecordWildCards ^
src/Main.hs ^
-threaded ^
-isrc ^
-rtsopts ^
-with-rtsopts=-I0 ^
-outputdir=../_build/hadrian ^
-j ^
-O ^
-o ../_build/hadrian
@set shakeArgs=--lint ^
--directory ^
".." ^
%*
@set hadrianArgs=--lint ^
--directory ^
".." ^
%*
@ghc %ghcArgs%
......@@ -27,4 +27,4 @@
@rem Unset GHC_PACKAGE_PATH variable, as otherwise ghc-cabal complains
@set GHC_PACKAGE_PATH=
@.shake\build %shakeArgs%
@..\_build\hadrian %hadrianArgs%
......@@ -30,22 +30,22 @@ function rl {
root="$(dirname "$(rl "$0")")"
mkdir -p "$root/.shake"
ghc \
"$root/src/Main.hs" \
-Wall \
-fno-warn-name-shadowing \
-XRecordWildCards \
-i"$root/src" \
-rtsopts \
-with-rtsopts=-I0 \
-threaded \
-outputdir="$root/.shake" \
-j -O \
-o "$root/.shake/build"
"$root/.shake/build" \
mkdir -p "$root/../_build"
ghc \
"$root/src/Main.hs" \
-Wall \
-fno-warn-name-shadowing \
-XRecordWildCards \
-i"$root/src" \
-rtsopts \
-with-rtsopts=-I0 \
-threaded \
-outputdir="$root/../_build/hadrian" \
-j -O \
-o "$root/../_build/hadrian"
"$root/../_build/hadrian" \
--lint \
--directory "$root/.." \
--colour \
......
......@@ -50,6 +50,7 @@ import System.IO
shakePath :: FilePath
shakePath = "hadrian"
-- TODO: Move to buildRootPath.
shakeFilesPath :: FilePath
shakeFilesPath = shakePath -/- ".db"
......
......@@ -9,17 +9,19 @@ import Settings.Paths
import Settings.User
import Stage
clean :: FilePath -> Action ()
clean dir = do
putBuild $ "| Remove files in " ++ dir ++ "..."
removeDirectoryIfExists dir
cleanRules :: Rules ()
cleanRules = do
"clean" ~> do
putBuild $ "| Remove files in " ++ buildRootPath ++ "..."
liftIO $ removeFiles buildRootPath ["//*"]
putBuild $ "| Remove files in " ++ programInplacePath ++ "..."
liftIO $ removeFiles programInplacePath ["//*"]
putBuild $ "| Remove files in inplace/lib..."
liftIO $ removeFiles "inplace/lib" ["//*"]
putBuild $ "| Remove files in " ++ derivedConstantsPath ++ "..."
liftIO $ removeFiles derivedConstantsPath ["//*"]
forM_ [Stage0 ..] $ \stage -> clean (buildRootPath -/- stageString stage)
clean (buildRootPath -/- "hadrian")
clean programInplacePath
clean "inplace/lib"
clean derivedConstantsPath
forM_ includesDependencies $ \file -> do
putBuild $ "| Remove " ++ file
removeFileIfExists file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment