-
Notifications
You must be signed in to change notification settings - Fork 154
/
clash-dev
executable file
·29 lines (25 loc) · 1.06 KB
/
clash-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
GHC_VERSION=$(ghc --numeric-version)
# Pass -DCLASH_OPAQUE={OPAQUE,INLINE} to GHC depending on the compiler version.
# See https://github.com/clash-lang/clash-compiler/pull/2511.
GHC_MAJOR_1=$(echo ${GHC_VERSION} | cut -d. -f1)
GHC_MAJOR_2=$(echo ${GHC_VERSION} | cut -d. -f2)
if [ ${GHC_MAJOR_1} -gt 9 ] || ([ ${GHC_MAJOR_1} -ge 9 ] && [ ${GHC_MAJOR_2} -ge 4 ]); then
OPAQUE="OPAQUE"
else
OPAQUE="NOINLINE"
fi
cabal build clash-lib clash-ghc --only-dependencies
ghci \
-fobject-code \
-iclash-ghc/src-bin-common/ \
-iclash-lib/src \
-iclash-ghc/src-ghc \
-Wall -Wcompat -DTOOL_VERSION_ghc=\"${GHC_VERSION}\" \
-XBangPatterns -XBinaryLiterals -XDataKinds -XDefaultSignatures \
-XDeriveDataTypeable -XDeriveFoldable -XDeriveFunctor -XDeriveGeneric \
-XDeriveLift -XDeriveTraversable -XDerivingStrategies -XInstanceSigs \
-XKindSignatures -XNoStarIsType -XPostfixOperators -XScopedTypeVariables \
-XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeOperators \
-XViewPatterns -XNoPolyKinds -DDEBUG -DCLASH_OPAQUE="${OPAQUE}" \
Clash.hs