-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·62 lines (49 loc) · 856 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
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/sh -e
CC=${CC:-clang50}
OBJ_FILES=
if `which ccache > /dev/null 2>&1` ; then
CC="ccache $CC"
fi
LIBS="
-L/usr/local/lib
-licuuc
-lcxxrt
"
BUILD_FLAGS="
-g
-Wall -Werror -Wno-unused-function
-fno-omit-frame-pointer
-fsanitize=undefined
-fno-sanitize=alignment
-std=c99
-isystem/usr/local/include
-Iinc
"
mkdir -p bin
mkdir -p obj
rm -f obj/*.o
for C_FILE in src/*.c ; do
OBJ_FILE=`echo $C_FILE | sed -e 's#\.c$#.o#' | sed -e 's#^src/#obj/#'`
$CC \
-c \
-o $OBJ_FILE \
$BUILD_FLAGS \
$C_FILE
OBJ_FILES="$OBJ_FILES $OBJ_FILE"
done
ar -rc bin/libtoml2.a $OBJ_FILES
$CC \
$BUILD_FLAGS \
$LIBS \
$OBJ_FILES \
-lcheck test/*.c \
./bin/libtoml2.a \
-o bin/libtoml2.test
$CC \
$BUILD_FLAGS \
$LIBS \
$OBJ_FILES \
cmd/burntsushi.c \
./bin/libtoml2.a \
-o bin/burntsushi
env MALLOC_OPTIONS=J ./bin/libtoml2.test