-
Notifications
You must be signed in to change notification settings - Fork 0
/
harvey.build
executable file
·128 lines (118 loc) · 3.23 KB
/
harvey.build
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
BFLAGS="-nostdlib -nostdinc -mno-implicit-float -ffreestanding -fno-builtin -fno-omit-frame-pointer -g -gdwarf-2 -ggdb -mno-red-zone -O0 -static -Wall -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas"
#CFLAGS="-c -I./include -I $APEX/include -I $APEX/amd64/include -I$HARVEY/sys/include -D_POSIX_SOURCE -D_BSD_EXTENSION -D_SUSV2_SOURCE -D__PLAN9__ -D_PLAN9_SOURCE -D_HARVEY_SOURCE -D SDL_VIDEO_DRIVER_PLAN9"
CFLAGS="-c -I./include -I $APEX/include -I $APEX/amd64/include -I$HARVEY/sys/include -D_POSIX_SOURCE -D_BSD_EXTENSION -D_SUSV2_SOURCE -D__PLAN9__ -D_PLAN9_SOURCE -D_HARVEY_SOURCE -D_LIMITS_EXTENSION -D_BSD_SOURCE -DHAVE_SOCK_OPTS -DHARVEY"
file=(
"src/SDL."
"src/SDL_error."
"src/SDL_fatal."
"src/audio/SDL_audio."
"src/audio/SDL_audiocvt."
"src/audio/SDL_audiodev."
"src/audio/SDL_mixer."
"src/audio/SDL_mixer_MMX."
"src/audio/SDL_mixer_m68k."
"src/audio/SDL_wave."
"src/cdrom/SDL_cdrom."
"src/cpuinfo/SDL_cpuinfo."
"src/events/SDL_active."
"src/events/SDL_events."
"src/events/SDL_expose."
"src/events/SDL_keyboard."
"src/events/SDL_mouse."
"src/events/SDL_quit."
"src/events/SDL_resize."
"src/file/SDL_rwops."
"src/joystick/SDL_joystick."
"src/stdlib/SDL_getenv."
"src/stdlib/SDL_iconv."
"src/stdlib/SDL_malloc."
"src/stdlib/SDL_qsort."
"src/stdlib/SDL_stdlib."
"src/stdlib/SDL_string."
"src/thread/SDL_thread."
"src/timer/SDL_timer."
"src/video/SDL_RLEaccel."
"src/video/SDL_blit."
"src/video/SDL_blit_0."
"src/video/SDL_blit_1."
"src/video/SDL_blit_A."
"src/video/SDL_blit_N."
"src/video/SDL_bmp."
"src/video/SDL_cursor."
"src/video/SDL_gamma."
"src/video/SDL_pixels."
"src/video/SDL_stretch."
"src/video/SDL_surface."
"src/video/SDL_video."
"src/video/SDL_yuv."
"src/video/SDL_yuv_mmx."
"src/video/SDL_yuv_sw."
"src/audio/dummy/SDL_dummyaudio."
"src/audio/plan9/SDL_plan9audio."
"src/cdrom/dummy/SDL_syscdrom."
"src/joystick/dummy/SDL_sysjoystick."
"src/loadso/dummy/SDL_sysloadso."
"src/thread/generic/SDL_syscond."
"src/thread/generic/SDL_sysmutex."
"src/thread/generic/SDL_syssem."
"src/thread/generic/SDL_systhread."
"src/timer/dummy/SDL_systimer."
"src/video/dummy/SDL_nullevents."
"src/video/dummy/SDL_nullmouse."
"src/video/dummy/SDL_nullvideo."
"src/video/plan9/SDL_plan9events."
"src/video/plan9/SDL_plan9mouse."
"src/video/plan9/SDL_plan9video."
"src/timer/SDL_timer."
"src/timer/plan9/SDL_systimer."
)
rm -rf *.o libsdl.a
if [ -z "$CC" ]; then
CC="clang"
fi
if [ "$CC" = "clang" ]; then
$BFLAGS = "$BFLAGS -Wno-frame-address"
fi
I=0
while [ -n "${file[I]}" ]
do
echo $CC $BFLAGS $CFLAGS "${file[I]}"c
$CC $BFLAGS $CFLAGS "${file[I]}"c
if [ $? -ne 0 ]
then
echo ""
echo "++++ ERROR ++++"
echo ""
exit 1
fi
I=$(( $I + 1 ))
done
I=0
LISTA=
while [ -n "${file[I]}" ]
do
LISTA="$LISTA `basename ${file[I]}`o"
I=$(( $I + 1 ))
done
echo ar -rs libsdl.a $LISTA
ar -rs libsdl.a $LISTA
if [ $? -ne 0 ]
then
echo ""
echo "++++ ERROR ++++"
echo ""
exit 1
fi
echo ranlib libsdl.a
ranlib libsdl.a
if [ $? -ne 0 ]
then
echo ""
echo "++++ ERROR ++++"
echo ""
exit 1
fi
rm -rf *.o
echo ""
echo "++ ALL OK ++"
echo ""