-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild_linux.sh
executable file
·130 lines (113 loc) · 3 KB
/
build_linux.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/sh
# any error code causes script to exit with error code
set -e
# echo everything
#set -x
colour_pass="\033[32;1m"
colour_default="\033[0m"
horiz_div="========================"
CC=clang
CPP=clang++
FLAGS="-fsanitize=address -fsanitize=undefined -Wall -Wextra -Werror -pedantic -g"
#
# [apg]
#
echo "building apg tests..."
cd apg
$CC $FLAGS -o test_rle_compress_file.bin tests/rle_compress.c -I ./
$CC $FLAGS -o test_rle_string.bin tests/rle_test.c -I ./
$CC $FLAGS -o test_hash.bin tests/hash_test.c -I ./
$CC $FLAGS -o test_is_file.bin tests/is_file.c -I ./
$CC $FLAGS -o test_dir_list.bin tests/dir_list.c -I ./
cd ..
#
# [apg_bmp]
#
echo "building apg_bmp tests..."
cd apg_bmp
$CC $FLAGS -o test_read_bmp.bin test_code/main_read.c apg_bmp.c -I./ -I test_code/ -I ../third_party/stb/ -DAPG_TGA_DEBUG_OUTPUT
$CC $FLAGS -o test_write_bmp.bin test_code/main_write.c apg_bmp.c -I./ -I test_code/ -I ../third_party/stb/ -DAPG_TGA_DEBUG_OUTPUT
cd ..
#
# [apg_console]
#
echo "building apg_console tests..."
cd apg_console
cp ../apg_pixfont/apg_pixfont.c ./
cp ../apg_pixfont/apg_pixfont.h ./
cp ../apg_unicode/apg_unicode.c ./
cp ../apg_unicode/apg_unicode.h ./
$CC $FLAGS tests/main.c apg_console.c apg_pixfont.c apg_unicode.c -I ./
cd ..
# NOTE -- no tests for apg_gldb at the moment (opengl is a pain to set up on build servers)
# [apg_gldb]
#
#
# [apg_interp]
#
echo "building apg_interp tests..."
cd apg_interp
$CC $FLAGS -std=c99 -I ./ tests/test.c -lm
cd ..
#
# [apg_jobs]
#
echo "building apg_jobs tests..."
cd apg_jobs
clang $SANS $FLAGS tests/main.c -I ./ apg_jobs.c -pthread
cd ..
#
# [apg_linechart]
#
echo "building apg_plot tests..."
cd apg_plot
$CC $FLAGS -std=c99 -D_APG_PLOT_UNIT_TEST -I./ -I../third_party/stb/ apg_plot.c -lm
cd ..
#
# [apg_maths]
#
echo "building apg_maths tests..."
cd apg_maths
$CC $FLAGS -std=c99 -I./ tests/test.c apg_maths.c -lm
cd ..
#
# [apg_mod]
#
echo "building apg_mod tests..."
cd apg_mod
bash ./build.sh
cd ..
#
# [apg_pixfont]
#
echo "building apg_pixfont tests..."
cd apg_pixfont
$CPP -c tests/test_pixfont.cpp -o tests/test_pixfont.o -I ./ -I ../third_party/stb/
$CC $FLAGS -c apg_pixfont.c -o apg_pixfont.o -I ./
$CC $FLAGS $SAN -o test_pixfont.bin apg_pixfont.o tests/test_pixfont.o -lm
$CC $SAN -o bakefont.bin utils/bake_font_array.c -I ../third_party/stb/ -lm
cd ..
#
# [apg_tga]
#
echo "building apg_tga tests..."
cd apg_tga
$CC $FLAGS -o test_read_tga test_code/main_read.c -I ./ -I test_code/ -I ../third_party/stb/ -DAPG_TGA_DEBUG_OUTPUT
$CC $FLAGS -o test_write_tga test_code/main_write.c -I ./ -I test_code/ -I ../third_party/stb/ -DAPG_TGA_DEBUG_OUTPUT
cd ..
#
# [apg_unicode]
#
echo "building apg_unicode tests..."
cd apg_unicode
$CC $FLAGS -o test_unicode.bin tests/main.c apg_unicode.c -I ./
cd ..
#
# [apg_wav]
#
echo "building apg_wav tests..."
cd apg_wav
$CC $FLAGS -I./ -Itests/ tests/main_write.c apg_wav.c -lm
$CC $FLAGS -I./ -Itests/ tests/main_read.c apg_wav.c -lm
cd ..
printf '%b%s\n%s\n%s\n%b\n' $colour_pass $horiz_div "Compile Check PASSED" $horiz_div $colour_default