-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
81 lines (55 loc) · 1.57 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#-----MACROS----#
#Compiler Macros
CC=nvcc
DB=-g -G
LIBS=-lgtest -lpthread
IF = -I ./
CFLAGS=--std=c++11 -g -G -pg -O0
#Locations
EXEDIR = gen/
OBJDIR = bin/
CR = cyclic-reduction/
TEST = tests/
UTIL = utils/
#Objects
OBJ_CR = $(OBJDIR)cu_cr_solver.o
OBJ_UTILS = $(OBJDIR)utils.o
OBJ_SS = $(OBJDIR)serial_solver.o
OBJS = $(OBJ_CR) $(OBJ_UTILS) $(OBJ_SS)
#Thomas Algorithm Serial Method
SS = serial_tSolver.cu serial_tSolver.h
#Cyclic-Reduction Method
CRM = $(addprefix $(CR), cu_cr_functors.cu cu_cr_solver.cu cu_cr_solver.h cu_cr_internal.h)
#Utility and Helper Files
UTILS = $(addprefix $(UTIL), utils.cu utils.h)
#Test Files
TF = $(addprefix $(TEST), test_all.cu test_cr.cu test_functors.cu test_serial_tSolver.cu test_cr_system.cu)
#-----RUN COMMANDS-----
install: init program
run: init
./$(EXEDIR)program p
test: init test_all
./$(EXEDIR)test_all
clean: clean_log
@(rm bin/* gen/* *.out program test_all) &> /dev/null || true
clean_log:
@(rm output.txt log.txt) &> /dev/null || true
clean_objs:
@(rm *.o) &> /dev/null || true
#-----MAKE COMMANDS-----
init: clean_log
@(mkdir bin gen) &> /dev/null || true
program: program.cu $(OBJS)
$(CC) $(IF) $(OBJS) -o $(EXEDIR)program program.cu
test_all: $(TF) $(OBJS)
$(CC) $(IF) $(OBJS) -o $(EXEDIR)test_all $(TEST)test_all.cu $(LIBS) $(CFLAGS)
cr: $(OBJ_CR)
ss: $(OBJ_SS)
utils: $(OBJ_UTILS)
#-----OBJECT COMMANDS-----
$(OBJ_CR): $(CRM)
$(CC) $(IF) -c $(CR)cu_cr_solver.cu $(CFLAGS) -o $@
$(OBJ_UTILS): $(UTILS)
$(CC) $(IF) -c $(UTIL)utils.cu $(CFLAGS) -o $@
$(OBJ_SS): $(SS)
$(CC) $(IF) -c serial_tSolver.cu -o $@