summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-03-14 22:32:35 +0100
committertv <tv@krebsco.de>2021-03-14 22:32:35 +0100
commitd151f66a8500f1b0a6aa2224f19e18062b172931 (patch)
tree24199e10c9ebc72b898188a0f2bdcf4b2e6ee244 /build
parent032cb86ff8108eb4915a692015da344a41f78506 (diff)
wipwip
Diffstat (limited to 'build')
-rwxr-xr-xbuild39
1 files changed, 39 insertions, 0 deletions
diff --git a/build b/build
new file mode 100755
index 0000000..83033d2
--- /dev/null
+++ b/build
@@ -0,0 +1,39 @@
+#! /bin/sh
+# usage: ./build [{dev,prod}]
+
+set -efu
+
+main() {
+ case ${1-dev} in
+ dev) build_dev;;
+ prod) build_prod;;
+ *) echo "$0: bad mode: $1" >&2; exit 1;;
+ esac
+}
+
+build_dev() {
+ ghc -Wall \
+ -i$HOME/stockholm/tv/5pkgs/haskell/xmonad-tv/src \
+ -isrc \
+ -odir tmp \
+ -hidir tmp \
+ src/main.hs \
+ -threaded \
+ -O0 \
+ -o tmp/main
+}
+
+# TODO for prod, don't -i external packages (libraries)
+build_prod() {
+ ghc -Wall \
+ -i$HOME/stockholm/tv/5pkgs/haskell/xmonad-tv/src \
+ -isrc \
+ -odir tmp \
+ -hidir tmp \
+ src/main.hs \
+ -threaded \
+ -O3 \
+ -o tmp/main
+}
+
+main "$@"