-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (22 loc) · 1.1 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
EXECUTABLES = vec-add vec-add-soln print-devices transpose transpose-soln
all: $(EXECUTABLES)
ifdef OPENCL_INC
CL_CFLAGS = -I$(OPENCL_INC)
endif
ifdef OPENCL_LIB
CL_LDFLAGS = -L$(OPENCL_LIB)
endif
vec-add: vec-add.c cl-helper.o
gcc $(CL_CFLAGS) $(CL_LDFLAGS) -std=gnu99 -o$@ $^ -lrt -lOpenCL
vec-add-soln: vec-add-soln.c cl-helper.o
gcc $(CL_CFLAGS) $(CL_LDFLAGS) -std=gnu99 -o$@ $^ -lrt -lOpenCL
print-devices: print-devices.c cl-helper.o
gcc $(CL_CFLAGS) $(CL_LDFLAGS) -std=gnu99 -o$@ $^ -lrt -lOpenCL
transpose: transpose.c cl-helper.o
gcc $(CL_CFLAGS) $(CL_LDFLAGS) -std=gnu99 -o$@ $^ -lrt -lOpenCL
transpose-soln: transpose-soln.c cl-helper.o
gcc $(CL_CFLAGS) $(CL_LDFLAGS) -std=gnu99 -o$@ $^ -lrt -lOpenCL
%.o : %.c %.h
gcc -c $(CL_CFLAGS) -std=gnu99 $<
clean:
rm -f $(EXECUTABLES) *.o