-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·38 lines (28 loc) · 821 Bytes
/
build
File metadata and controls
executable file
·38 lines (28 loc) · 821 Bytes
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
#!/usr/bin/env bash
set -e
if [ -z $CC ]; then
CC=$(command -v clang || echo gcc)
fi
if ! command -v "$CC" >/dev/null; then
echo "'$CC' not found. Install 'clang' or 'gcc' or set \$CC to the C compiler executable."
exit 1
fi
mkdir -p obj bin
extra_opts=""
if [ ${OPTIMIZE:-1} -ne 0 ]; then
extra_opts="-O3 -DRELEASE"
else
extra_opts="-g"
fi
if [ ${ALWAYS_PERSIST_SEARCH_HISTORY:-0} -ne 0 ]; then
extra_opts="$extra_opts -DALWAYS_PERSIST_SEARCH_HISTORY"
fi
if [ ${FULL_REBUILD:-0} -ne 0 -o ! -e obj/stb.o ]; then
echo "Building obj/stb.o"
$CC -std=c11 -O3 -c -o obj/stb.o lib/stb.c
fi
ld -r -b binary data/DejaVuSans.ttf -o obj/font.o
$CC $extra_opts -std=c11 -Wshadow -pthread -I. -o i2x obj/stb.o obj/font.o src/main.c -lm -lX11 -lGL -lGLX -lXi
if [ ${OPTIMIZE:-1} -ne 0 ]; then
strip i2x
fi