From f51618000e1d96543e5e0ad72219855e9dea42d8 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 4 Jun 2021 00:37:48 +0200 Subject: wip --- build | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 build (limited to 'build') 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 "$@" -- cgit v1.2.3