-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (50 loc) · 2.66 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
#---------------------------------------------------------------------------------------------------
# Compiler selection
#---------------------------------------------------------------------------------------------------
CXX = g++
#---------------------------------------------------------------------------------------------------
# Directories
#---------------------------------------------------------------------------------------------------
OBJDIR = build
SRCDIR = src
#---------------------------------------------------------------------------------------------------
# Executables
#---------------------------------------------------------------------------------------------------
EXE = mrclean-greedy
#---------------------------------------------------------------------------------------------------
# Object files
#---------------------------------------------------------------------------------------------------
OBJ = GreedySolver.o Timer.o CleanSolution.o BinContainer.o AddRowGreedy.o
ALL_OBJ = $(OBJ) main.o
#---------------------------------------------------------------------------------------------------
# Compiler options
#---------------------------------------------------------------------------------------------------
CXXFLAGS = -O3 -Wall -fPIC -fexceptions -DIL_STD -std=c++11 -fno-strict-aliasing
#---------------------------------------------------------------------------------------------------
all: CXXFLAGS += -DNDEBUG
all: $(EXE)
debug: CXXFLAGS += -g
debug: $(EXE)
mrclean-greedy: $(addprefix $(OBJDIR)/, main.o)
$(CXX) -o $@ $(addprefix $(OBJDIR)/, $(ALL_OBJ))
$(OBJDIR)/main.o: $(addprefix $(SRCDIR)/, main.cpp) \
$(addprefix $(OBJDIR)/, $(OBJ))
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
$(OBJDIR)/AddRowGreedy.o: $(addprefix $(SRCDIR)/, AddRowGreedy.cpp AddRowGreedy.h) \
$(addprefix $(OBJDIR)/, BinContainer.o)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
$(OBJDIR)/CleanSolution.o: $(addprefix $(SRCDIR)/, CleanSolution.cpp CleanSolution.h)
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/GreedySolver.o: $(addprefix $(SRCDIR)/, GreedySolver.cpp GreedySolver.h) \
$(addprefix $(SRCDIR)/, MrCleanUtils.h) \
$(addprefix $(OBJDIR)/, BinContainer.o)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
$(OBJDIR)/BinContainer.o: $(addprefix $(SRCDIR)/, BinContainer.cpp BinContainer.h)
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/Timer.o: $(addprefix $(SRCDIR)/, Timer.cpp Timer.h)
$(CXX) $(CXXFLAGS) -c -o $@ $<
#---------------------------------------------------------------------------------------------------
.PHONY: clean
clean:
/bin/rm -f $(OBJDIR)/*.o
#---------------------------------------------------------------------------------------------------