-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 1.01 KB
/
Makefile
File metadata and controls
34 lines (26 loc) · 1.01 KB
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
NVCC := /usr/local/cuda/bin/nvcc -arch=sm_20
CXX := g++
LINK := $(NVCC)
HEADERS := $(wildcard src/*.h)
SOURCES := $(wildcard src/*.cpp) $(wildcard src/*.cu)
OBJS := $(patsubst src/%, bin/%.o, $(SOURCES))
bin/%.cpp.o: src/%.cpp $(HEADERS)
mkdir -p bin
$(CXX) -c $< -o $@
bin/%.cu.o: src/%.cu $(HEADERS)
mkdir -p bin
$(NVCC) -c $< -o $@
.PHONY: test
test: $(OBJS)
cd test/ && make main.o
$(LINK) test/main.o $(OBJS) -o bin/test
bin/test
test_connectedComponents: test/test_connectedComponents.cu src/computeConnectedComponents.cu src/computeTreeFunctions.cu
$(NVCC) test/test_connectedComponents.cu src/computeConnectedComponents.cu src/computeTreeFunctions.cu -o test_connectedComponents.test
./test_connectedComponents.test
test_computeTreeFunctions: test/test_computeTreeFunctions.cu src/computeTreeFunctions.cu
$(NVCC) $(DEBUG) test/test_computeTreeFunctions.cu src/computeTreeFunctions.cu -o test_computeTreeFunctions.test
./test_computeTreeFunctions.test
rm test_computeTreeFunctions.test
clean:
rm bin/*