-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
43 lines (32 loc) · 931 Bytes
/
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
CC=clang
EXEC = libcltk.so example/cltk_test example_image/cltk_image_test gemm_cl/gemm
all: $(EXEC)
CFLAGS = -I include -I stb
CFLAGS += -Wno-deprecated-declarations -fPIC
LIB_LDFLAGS = -L /usr/lib/x86_64-linux-gnu/ -lOpenCL
LIB_OBJS = \
src/cltk.o
LDFLAGS = -L. -lm -lcltk -lOpenCL
OBJS = \
example/cltk_test.o
IMG_OBJS = \
example_image/cltk_image_test.o
GEMM_OBJS = \
gemm_cl/gemm.o
deps =
%.o: %.c
$(CC) $(CFLAGS) -o $@ -MMD -MF [email protected] -c $<
deps += $(OBJS:%.o=%.o.d)
deps += $(IMG_OBJS:%.o=%.o.d)
deps += $(GEMM_OBJS:%.o=%.o.d)
deps += $(LIB_OBJS:%.o=%.o.d)
example/cltk_test: $(OBJS) libcltk.so
$(CC) -o $@ $^ $(LDFLAGS)
example_image/cltk_image_test: $(IMG_OBJS) libcltk.so
$(CC) -o $@ $^ $(LDFLAGS)
gemm_cl/gemm: $(GEMM_OBJS) libcltk.so
$(CC) -o $@ $^ $(LDFLAGS)
libcltk.so: $(LIB_OBJS)
$(CC) -shared -o $@ $^ $(LIB_LDFLAGS)
clean:
$(RM) -f $(EXEC) $(LIB_OBJS) $(OBJS) $(IMG_OBJS) $(GEMM_OBJS) $(deps)