From 10affaf0110a0c9562769cc2a85ff508083c8664 Mon Sep 17 00:00:00 2001 From: "Trevor L. McDonell" Date: Thu, 9 Jun 2016 11:15:52 +1000 Subject: [PATCH] utils script wibbles --- utils/ghc-core | 11 +++++++++++ utils/ghci | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 utils/ghc-core diff --git a/utils/ghc-core b/utils/ghc-core new file mode 100755 index 0000000..0ae5192 --- /dev/null +++ b/utils/ghc-core @@ -0,0 +1,11 @@ +#!/bin/bash + +GHC_CORE=`which -a ghc-core | grep -v "\./ghc-core"` + +$GHC_CORE --no-cast --no-asm -- \ + -odir dist/build -hidir dist/build \ + -optP -include -optP dist/build/autogen/cabal_macros.h \ + -iutils -Iinclude \ + -O2 \ + $@ + diff --git a/utils/ghci b/utils/ghci index 1fa0a02..0b89597 100755 --- a/utils/ghci +++ b/utils/ghci @@ -3,15 +3,15 @@ # Get cabal to load up ghci for us. This will set the environment appropriately # if we have a local sandbox installation. # -GHC="cabal exec ghc --" +GHC="stack exec ghci --" GHC_FLAGS="$GHC_FLAGS - --interactive + -iutils + -hide-package language-c -DUNIX -DACCELERATE_DEBUG -DACCELERATE_BOUNDS_CHECKS - -DACCELERATE_INTERNAL_CHECKS - -iutils" + -DACCELERATE_INTERNAL_CHECKS" # If we have specified one command line argument, but that file doesn't exist, # search the source files for something with that name prefix. @@ -22,8 +22,8 @@ GHC_FLAGS="$GHC_FLAGS # # > ghci Data/Array/Accelerate/Trafo/Sharing.hs # -FILES=`find Data -iname "$1*" -name "*.hs"` -COUNT=`echo $FILES | wc -w` +FILES=$(find Data -iname "$1*" -name "*.hs") +COUNT=$(echo $FILES | wc -w) if [ $COUNT -eq 1 ]; then $GHC $GHC_FLAGS $FILES