-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (39 loc) · 1.21 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
# environment
SM := 35
GCC := g++
NVCC := nvcc
# Remove function
RM = rm -f
# Specify opencv Installation
#opencvLocation = /usr/local/opencv
opencvLIB= `pkg-config --libs opencv`
opencvINC= `pkg-config --cflags opencv`
# Compiler flags:
# -g debugging information
# -Wall turns on most compiler warnings
GENCODE_FLAGS := -gencode arch=compute_$(SM),code=sm_$(SM)
LIB_FLAGS := -lcudadevrt -lcudart
NVCCFLAGS := -O3
GccFLAGS = -fopenmp -O3
# The build target executable:
TARGET = heq
TARGETS = $(TARGET)
all: build
debug: GccFLAGS += -DDEBUG -g -Wall
debug: NVCCFLAGS += -g -G
debug: all
build: $(TARGETS)
$(TARGET): src/dlink.o src/main.o src/$(TARGET).o
$(NVCC) $(NVCCFLAGS) $(opencvINC) $^ -o $@ $(GENCODE_FLAGS) $(opencvLIB) -link
src/dlink.o: src/$(TARGET).o
$(NVCC) $(NVCCFLAGS) $^ -o $@ $(GENCODE_FLAGS) -dlink
src/main.o: src/main.cpp
$(GCC) $(GccFLAGS) $(opencvLIB) $(opencvINC) -c $< -o $@
src/$(TARGET).o: src/$(TARGET).cu
$(NVCC) $(NVCCFLAGS) -dc $< -o $@ $(GENCODE_FLAGS)
%: src/%.cpp
$(GCC) $(GccFLAGS) $(opencvLIB) $(opencvINC) $< -o $@ $(OPENCV_LINK)
clean:
$(RM) $(TARGETS) src/*.o *.o *.tar* *.core* *out*.jpg *input*.jpg
rmlogs:
$(RM) run_exec.log exec_proj.*.out exec_heq.*.out