-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·39 lines (28 loc) · 936 Bytes
/
build.sh
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
30
31
32
33
34
35
36
37
38
#!/bin/bash
# - setting the module main function explicitly for the executable - avoids Main.o files being generated in tmp and confusing the build.
# - Using -i will pull in dependnecies
# do we need -make also ?
FLAGS="-i./src -O2 -outputdir tmp"
# needed dirs
[ -d tmp ] || mkdir tmp
[ -d target ] || mkdir target
# uncomment to test module in isolation
# files=' src/Metadata.hs '
# files=' src/FacetCalc.hs '
# files=' src/Search.hs '
# files=' src/Query.hs '
# files=' src/Service.hs '
# files=' src/Record.hs '
# files=' src/Service.hs '
# files=' src/ParseMCP20.hs '
# files=' src/FreeText.hs '
# files=' src/LoadImage.hs '
# main binaries
files=' src/LoadSchemes.hs src/Harvest.hs src/Service.hs src/LoadImage.hs '
for i in $files; do
# i # eg. src/Warp.hs
f="$(basename $i)" # Warp.hs
w="${f%.hs}" # Warp
echo $f;
ghc $FLAGS -main-is "$w.main" "$i" -o "target/$w"
done