-
Notifications
You must be signed in to change notification settings - Fork 69
/
Makefile
executable file
·143 lines (118 loc) · 3.62 KB
/
Makefile
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
131
132
133
134
135
136
137
138
139
140
141
142
# Note: this VPATH bit is just a hack to avoid mucking with the build
# system after splitting the directory tree into various subdirs..
# really need to clean this up but I've got better things to work on
# right now:
VPATH = tests-2d:tests-3d:tests-cl:util:wrap
TESTS_2D = \
test-fill \
test-fill2 \
test-replay \
test-copy \
test-fb \
test-composite \
test-composite2 \
test-multi
TESTS_3D = \
test-varyings \
test-quad-attributeless \
test-float-int \
test-query \
test-draw \
test-clear \
test-es2gears \
test-piglit-bad \
test-piglit-good \
test-caps \
test-stencil \
test-mipmap \
test-cubemap \
test-compiler \
test-enable-disable \
test-quad-flat \
test-quad-flat2 \
test-quad-textured \
test-quad-textured-3d \
test-quad-flat-fbo \
test-strip-smoothed \
test-cat \
test-cube \
test-cube-textured \
test-tex \
test-vertex \
test-triangle-smoothed \
test-triangle-quad \
test-instanced \
test-tf
TESTS_CL = \
test-simple \
test-image
TESTS = $(TESTS_2D) $(TESTS_3D) $(TESTS_CL)
UTILS = bmp.o
CFLAGS = -Iincludes -Iutil
# Build Mode:
# bionic - build for gnu/linux style filesystem, linking
# against android libc and libs in /system/lib
# glibc - build for gnu/linux glibc, linking against
# normal gnu dynamic loader
BUILD ?= bionic
ifeq ($(strip $(BUILD)),bionic)
# Note: setup symlinks in /system/lib to the vendor specific .so's in
# /system/lib/egl because android's dynamic linker can't seem to cope
# with multiple -rpath's..
# Possibly we don't need to link directly against gpu specific libs
# but I was getting eglCreateContext() failing otherwise.
LFLAGS_3D = -lEGL_adreno200 -lGLESv2_adreno200
LFLAGS_2D = -lC2D2 -lOpenVG
LFLAGS_CL = -lOpenCL
LDFLAGS_MISC = -lgsl -llog -lcutils -lstdc++ -lstlport -lm
CFLAGS += -DBIONIC
CC = gcc -L /system/lib -mfloat-abi=soft
LD = ld --entry=_start -nostdlib --dynamic-linker /system/bin/linker -rpath /system/lib -L /system/lib
# only build c2d2 bits for android, otherwise we don't have the right
# headers/libs:
WRAP_C2D2 = wrap-c2d2.o
else ifeq ($(strip $(BUILD)),glibc)
LFLAGS_3D = -lEGL -lGLESv2
LFLAGS_2D =
#LFLAGS_CL = -lOpenCL
LDFLAGS_MISC = -lX11 -lm
CFLAGS += -DSUPPORT_X11
CC = gcc -L /usr/lib
LD = gcc -L /usr/lib
WRAP_C2D2 =
else
error "Invalid build type"
endif
LFLAGS = $(LFLAGS_2D) $(LFLAGS_3D) $(LFLAGS_CL) $(LDFLAGS_MISC) -ldl -lc
all: tests-3d tests-2d tests-cl
utils: libwrap.so $(UTILS) redump cffdump pgmdump zdump
tests-2d: $(TESTS_2D)
tests-3d: $(TESTS_3D)
tests-cl: $(TESTS_CL)
clean:
rm -f *.bmp *.dat *.so *.o *.rd *.html *-cffdump.txt *-pgmdump.txt *.log redump cffdump pgmdump $(TESTS)
wrap%.o: wrap%.c
$(CC) -fPIC -g -c -ldl -llog -c -Iincludes -Iutil $< -o $@
%.o: %.c
$(CC) -fPIC -g -c $(CFLAGS) $(LFLAGS) $< -o $@
libwrap.so: wrap-util.o wrap-syscall.o $(WRAP_C2D2)
$(LD) -shared -ldl -lc -llog $^ -o $@
libwrapfake.so: wrap-util.o wrap-syscall-fake.o
$(LD) -shared -ldl -lc -llog $^ -o $@
test-%: test-%.o $(UTILS)
$(LD) $^ $(LFLAGS) -o $@
# build redump normally.. it doesn't need to link against android libs
redump: redump.c
gcc -g $^ -o $@
envytools/Makefile:
(cd envytools; cmake .)
envytools/rnn/librnn.a:
envytools/util/libenvyutil.a:
(cd envytools; make rnn)
RNN = envytools/rnn/librnn.a envytools/util/libenvyutil.a
cffdump: cffdump.c disasm-a2xx.c disasm-a3xx.c script.c io.c rnnutil.c $(RNN)
gcc -g $(CFLAGS) -Wall -Wno-packed-bitfield-compat -I. -Ienvytools/include $^ -lxml2 -llua -larchive -o $@
pgmdump: pgmdump.c disasm-a2xx.c disasm-a3xx.c io.c
gcc -g $(CFLAGS) -Wno-packed-bitfield-compat -I. $^ -larchive -o $@
zdump: zdump.c
gcc -g $(CFLAGS) -Wall -Wno-packed-bitfield-compat -I. $^ -o $@