-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
101 lines (67 loc) · 2.27 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
# Makefile make me fast and accurate
CC = g++
FLAGS = --std=c++11 -fopenmp -O #-g -Wall
SRC_DIR = src/
BIN = bin/
#REF
SRC_REF = msa-ref.cpp
SOURCES_REF = $(SRC_REF:%.cpp=$(SRC_DIR)%.cpp)
OBJ_REF = $(SOURCES_REF:$(SRC_DIR)%.cpp=$(BIN)%.o)
EXE_REF = ref
#THREAD
SRC_THREAD = msa-thread.cpp
SOURCES_THREAD = $(SRC_THREAD:%.cpp=$(SRC_DIR)%.cpp)
OBJ_THREAD = $(SOURCES_THREAD:$(SRC_DIR)%.cpp=$(BIN)%.o)
EXE_THREAD = thread
#OPENMP
SRC_OPENMP = msa-openmp.cpp
SOURCES_OPENMP = $(SRC_OPENMP:%.cpp=$(SRC_DIR)%.cpp)
OBJ_OPENMP = $(SOURCES_OPENMP:$(SRC_DIR)%.cpp=$(BIN)%.o)
EXE_OPENMP = openmp
#OPENMP-TASK
SRC_OPENTASK = msa-opentask.cpp
SOURCES_OPENTASK = $(SRC_OPENTASK:%.cpp=$(SRC_DIR)%.cpp)
OBJ_OPENTASK = $(SOURCES_OPENTASK:$(SRC_DIR)%.cpp=$(BIN)%.o)
EXE_OPENTASK = opentask
#MISC
SRC_MISC = matrix.cpp
SOURCES_MISC = $(SRC_MISC:%.cpp=$(SRC_DIR)%.cpp)
OBJ_MISC = $(SOURCES_MISC:$(SRC_DIR)%.cpp=$(BIN)%.o)
MISC = misc
# All objects... Everything added above should be appended here.
# OBJ = $(OBJ_REF) $(OBJ_THREAD)
EXE = $(EXE_REF) $(EXE_THREAD) $(EXE_OPENMP) $(EXE_OPENTASK)
EXE_ARGS = input/test_input_1500.in
CCFLAGS = -I$(SRC_DIR)
all: $(EXE)
#CLEAN
cleanall:
rm -rf bin/
clean:
rm -f bin/*
#EXECUTABLES
$(EXE_REF): $(OBJ_REF) | $(BIN)
$(CC) $(OBJ_REF) $(CCFLAGS) $(FLAGS) -o $(BIN)$(EXE_REF)
$(EXE_THREAD): $(OBJ_THREAD) $(OBJ_MISC) | $(BIN)
$(CC) $(OBJ_THREAD) $(OBJ_MISC) $(CCFLAGS) $(FLAGS) -o $(BIN)$(EXE_THREAD)
$(EXE_OPENMP): $(OBJ_OPENMP) $(OBJ_MISC) | $(BIN)
$(CC) $(OBJ_OPENMP) $(OBJ_MISC) $(CCFLAGS) $(FLAGS) -o $(BIN)$(EXE_OPENMP)
$(EXE_OPENTASK): $(OBJ_OPENTASK) $(OBJ_MISC) | $(BIN)
$(CC) $(OBJ_OPENTASK) $(OBJ_MISC) $(CCFLAGS) $(FLAGS) -o $(BIN)$(EXE_OPENTASK)
#OBJECTS
$(OBJ_REF): $(SOURCES_REF) | $(BIN)
$(CC) -c $(SOURCES_REF) $(CCFLAGS) $(FLAGS) -o $(OBJ_REF)
$(OBJ_THREAD): $(SOURCES_THREAD) | $(BIN)
$(CC) -c $(SOURCES_THREAD) $(CCFLAGS) $(FLAGS) -o $(OBJ_THREAD)
$(OBJ_OPENMP): $(SOURCES_OPENMP) | $(BIN)
$(CC) -c $(SOURCES_OPENMP) $(CCFLAGS) $(FLAGS) -o $(OBJ_OPENMP)
$(OBJ_OPENTASK): $(SOURCES_OPENTASK) | $(BIN)
$(CC) -c $(SOURCES_OPENTASK) $(CCFLAGS) $(FLAGS) -o $(OBJ_OPENTASK)
#MISC
$(MISC): $(OBJ_MISC)
$(OBJ_MISC): $(SOURCES_MISC) | $(BIN)
$(CC) -c $(SOURCES_MISC) $(CCFLAGS) $(FLAGS) -o $(OBJ_MISC)
#Make BIN?
$(BIN):
mkdir -p $(BIN)