-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 861 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 861 Bytes
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
CC=g++
SRC_DIR := .
OBJ_DIR := obj
BUILD_DIR := build/
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES))
LDLIBFLAGS := --cudart static -shared -link -Wno-deprecated-gpu-targets
LDFLAGS := -lcufft -Wno-deprecated-gpu-targets
CPPFLAGS := ...
CXXFLAGS := -O3 --use_fast_math -Xcompiler -fPIC -std=c++11 -Wno-deprecated-gpu-targets
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: libcuFFTAdvisor.so cuFFTAdvisor
# Tool invocations
libcuFFTAdvisor.so: $(OBJ_FILES)
mkdir -p $(BUILD_DIR)
nvcc $(LDLIBFLAGS) -o $(BUILD_DIR)$@ $^
cuFFTAdvisor: $(OBJ_FILES)
mkdir -p $(BUILD_DIR)
nvcc -o $(BUILD_DIR)$@ $^ $(LDFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
mkdir -p $(@D)
nvcc $(CXXFLAGS) -c -o $@ $<
# Other Targets
clean:
rm -rf $(OBJ_DIR) $(BUILD_DIR)