-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
26 lines (20 loc) · 952 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
EXECUTABLE_NAME=UCLATCH
CPP=g++
NVCC=nvcc
ARCH=sm_30
INC=-I/usr/local/cuda/include/
NVCCFLAGS=-Wall -Wextra -Werror -Wshadow -Ofast -fomit-frame-pointer -march=native -funroll-all-loops -fpeel-loops -ftracer -ftree-vectorize
CPPFLAGS=-Wall -Wextra -Werror -Wshadow -pedantic -Ofast -std=gnu++17 -fomit-frame-pointer -march=native -flto -funroll-all-loops -fpeel-loops -ftracer -ftree-vectorize
LIBS=-L/usr/local/cuda/lib64 -lcudart -lopencv_core -lopencv_features2d -lopencv_highgui -lopencv_imgcodecs -lpthread
CPPSOURCES=$(wildcard *.cpp)
CUSOURCES=$(wildcard *.cu)
OBJECTS=$(CPPSOURCES:.cpp=.o) $(CUSOURCES:.cu=.o)
all: $(CPPSOURCES) $(CUSOURCES) $(EXECUTABLE_NAME)
$(EXECUTABLE_NAME) : $(OBJECTS)
$(CPP) $(CPPFLAGS) $(OBJECTS) -o $@ $(LIBS)
%.o:%.cpp
$(CPP) -c $(INC) $(CPPFLAGS) $< -o $@
%.o:%.cu
$(NVCC) --use_fast_math -arch=$(ARCH) -O3 -ccbin $(CC) -std=c++11 -c $(INC) -Xcompiler "$(NVCCFLAGS)" $< -o $@
clean:
rm -rf *.o $(EXECUTABL