-
Notifications
You must be signed in to change notification settings - Fork 6
/
compile.sh
executable file
·48 lines (39 loc) · 1.88 KB
/
compile.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
39
40
41
42
43
44
45
46
47
#!/bin/sh
# Alternative to gkc compilation with make/automake: just run
# Note:
# * uses pre-built parser in the Builtparser folder, not the bison/flex combo
# * configuration is set in config.h
# First set and check the C compiler to be used
[ -z "$CC" ] && CC="gcc"
if [ -z "$(which $CC 2>/dev/null)" ]; then
echo "Error: No compiler found"
exit 1
fi
# Note:
# * the -static flag is for static linking, can be safely removed
# * optionally add other switches, like -pg switch for profiling:
${CC} -O3 -Wall -Wmissing-field-initializers -static -o gkc \
Main/gkc.c \
Db/dbmem.c \
Db/dballoc.c Db/dbdata.c Db/dblock.c Db/dbindex.c Db/dbdump.c \
Db/dblog.c Db/dbhash.c Db/dbcompare.c Db/dbquery.c Db/dbutil.c Db/dbmpool.c \
Db/dbjson.c Db/dbschema.c \
json/yajl_all.c \
cjson/cjson.c \
Reasoner/build.c Reasoner/clstore.c Reasoner/clterm.c Reasoner/derive.c \
Reasoner/glb.c Reasoner/mem.c \
Reasoner/printerrutils.c Reasoner/rgenloop.c Reasoner/rmain.c Reasoner/subsume.c Reasoner/unify.c \
Reasoner/resolve.c Reasoner/simp.c Reasoner/strat.c Reasoner/rewrite.c Reasoner/history.c \
Reasoner/prob.c Reasoner/hash.c \
Reasoner/clmeta.c Reasoner/guide.c Reasoner/propagate.c Reasoner/init.c \
Reasoner/analyze.c Reasoner/chains.c Reasoner/prop.c Reasoner/makeguide.c\
Printer/dbotterprint.c \
Builtparser/dbotter.tab.c Builtparser/dbotter.yy.c Builtparser/dbparse.c Builtparser/dbprolog.tab.c \
Builtparser/dbprolog.yy.c Builtparser/dbclausify.c Builtparser/jsparse.c \
-lm
# Note: for a simple overview of available warning flags see
# https://fastcompression.blogspot.com/2019/01/compiler-warnings.html
# like
# -Wall -Wextra -Wcast-qual -Wcast-align -Wstrict-aliasing -Wpointer-arith -Winit-self
# -Wshadow -Wswitch-enum -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls
# -Wfloat-equal -Wundef -Wvla -Wdeclaration-after-statement -Wc++-compat