-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwbuild
executable file
·58 lines (47 loc) · 1.38 KB
/
wbuild
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
#!/usr/bin/bash
# opt?
# (don't optimize as debugging won't tell the truth!)
#OPT=-O3
CC="cc -Wno-string-compare"
# --- dependencies (poor mans make?)
if [[ jio.c -nt w.x ]]; then
rm w.x wless.x 2>/dev/null
fi
if [[ jio.h -nt w.x ]]; then
rm w.x wless.x 2>/dev/null
fi
if [[ table.c -nt w.x ]]; then
rm w.x 2>/dev/null
fi
if [[ graphics.c -nt wless.x ]]; then
rm wless.x 2>/dev/null
fi
if [[ experimental.c -nt wless.x ]]; then
rm wless.x 2>/dev/null
fi
# --- compile w.c
if [[ w.c -nt w.x ]]; then
echo "--- w.c changed, recompiling w.x..."
echo "`date --iso=s` #=CC w.c" >> .wlog
rm w.x 2>/dev/null
$CC $OPT -g -w jio.c w.c -o w.x -lunistring || (exit 4711) || exit
fi
# --- compile spinner.c
# - if fails, ignore
if [[ Play/spin.c -nt spin.x ]]; then
echo "--- spin.c changed, recompiling w.x..."
echo "`date --iso=s` #=CC spin.c" >> .wlog
rm spin.x 2>/dev/null
$CC $OPT -g -w Play/spin.c -o spin.x # || exit 4711
fi
# --- compile wless.c
# - if fails, ignore
if [[ wless.c -nt wless.x ]]; then
echo "--- wless.c changed, recompiling wless.x..."
echo "`date --iso=s` #=CC wless.c" >> .wlog
rm wless.x 2>/dev/null
$CC $OPT -g -w jio.c wless.c -o wless.x || exit 4711
fi
#
# $CC -g -w w.c && ((echo "run http://yesco.org/";echo "where") | gdb ./a.out )
cc -lunistring 2>&1 | grep main >/dev/null || echo "%% ./wbuild: MISSING library 'libunistring' please install"