This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
forked from keithshep/llvm-fs
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.bash
executable file
·63 lines (57 loc) · 1.64 KB
/
build.bash
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# by default use fsc, or fsharpc
if [ -z "$FSC" ]; then
if command -v fsc >/dev/null 2>&1; then
FSC=fsc
elif command -v fsharpc >/dev/null 2>&1; then
FSC=fsharpc
else
echo "No FSharp compiler found!"
exit 1
fi
fi
# exit on error and don't allow the use of unset variables
set -o errexit
set -o nounset
set -x
# build the LLVM binding DLL
${FSC} --nologo --debug --target:library --out:LLVMFSharp.dll \
src/LLVM/FFIUtil.fs \
src/LLVM/Generated.fs \
src/LLVM/Core.fs \
src/LLVM/BitReader.fs \
src/LLVM/ExecutionEngine.fs \
src/LLVM/Extra.fs \
src/LLVM/Target.fs \
src/LLVM/Quote.fs
# uncomment the following to build and run the tests
#echo "a very basic test"
#${FSC} --nologo -r LLVMFSharp.dll test/simpletest.fs
#mono simpletest.exe
#
#echo "a bit more complicated: this version uses the execution engine"
#${FSC} --nologo -r LLVMFSharp.dll test/simpletest2.fs
#mono simpletest2.exe
#
#echo "compile C code against two add functions built from LLVM"
#${FSC} --nologo -r LLVMFSharp.dll test/add.fs
#mono add.exe
#llc -march=x86-64 -filetype=obj addModule.bc
#gcc -o printadds addModule.o test/printadds.c
#./printadds
#
#echo "test that the API works with C#"
#dmcs -out:CSSimpleTest2.exe -r:LLVMFSharp.dll test/CSSimpleTest2.cs
#mono CSSimpleTest2.exe
#
#echo "metadata test"
#${FSC} --nologo -r LLVMFSharp.dll test/metadatatest.fs
#mono metadatatest.exe
#
#echo "quote test"
#${FSC} --nologo -r LLVMFSharp.dll test/quotetest.fs
#mono quotetest.exe
#llc -march=x86-64 -filetype=obj quotemodule.bc
#llvm-dis quotemodule.bc
#gcc -o quotetest quotemodule.o test/quotetest.c
#./quotetest