-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
47 lines (37 loc) · 1.23 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
# Copyright Scott Wales 2010
# Distributed under the Boost Software Licence, Version 1.0.
# (See accompanying file LICENCE_1_0.txt or copy at
# http://www.boost.org/LICENCE_1_0.txt)
CXX=g++-4.5
BOOST=/usr/local/boost
BOOST_INCDIR=$(BOOST)/include
OPENCL=/usr/local
OPENCL_INCDIR=$(OPENCL)/include
OPENCL_LIBDIR=$(OPENCL)/lib
OPENCL_LIB=-framework OpenCL
CPPFLAGS+=-MMD -MP -MF build/$*.dep
CPPFLAGS+=-I./include
CPPFLAGS+=-I$(BOOST_INCDIR) -I$(OPENCL_INCDIR)
CPPFLAGS+=-Wall -Werror -Wextra
CXXFLAGS+=-O2 -g
CXXFLAGS+=-std=c++0x
LDFLAGS+=-L$(OPENCL_LIBDIR)
LDLIBS+=$(OPENCL_LIB)
all:check
check:test/platform test/device test/context test/program test/kernel
clean:
$(RM) -r build test
.PHONY:all check clean
test/platform:build/platform.o
test/device:build/device.o build/platform.o
test/context:build/context.o build/device.o build/platform.o
test/program:build/program.o build/context.o build/device.o build/platform.o
test/kernel:build/kernel.o build/program.o build/context.o build/device.o build/platform.o
build/%.o:src/%.cpp
mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
test/%:build/test/%.o
mkdir -p $(dir $@)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
./$@
-include $(wildcard build/*.dep) $(wildcard build/test/*.dep)