-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (38 loc) · 954 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Specify Target Application
TARGET = test_governor
# Specify Desired Compilers
CXX := g++
LINK := g++
# Includes
INCLUDES =
# Common flags
COMMONFLAGS += -std=c++11 $(INCLUDES)
CXXFLAGS += -pipe $(COMMONFLAGS)
LIBS := -lboost_program_options -lboost_system -lboost_thread -lpthread -lboost_filesystem
CPP_FILES = $(wildcard ./*.cpp)
OBJS = $(patsubst %.cpp,./%.cpp.o,$(notdir $(CPP_FILES)))
# Linker
LINKLINE = $(LINK) -o $(TARGET) $(OBJS) $(LIBS)
# Declare file types
.SUFFIXES: .cpp .o
# Setup our target
all: release
# Prevent Make from rebuilding Makefile
Makefile: ;
# Setup Debug Compile
debug: CXXFLAGS += -DDEBUG -g -Wall
debug: $(TARGET)
@echo Debug Done
# Setup Release Compile
release: CXXFLAGS += -O3
release: $(TARGET)
@echo Runtime Done
# Build Application
$(TARGET): $(OBJS) Makefile
$(LINKLINE)
# Compile CPP Files
%.cpp.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean Up!
clean:
rm -f rm -rf $(TARGET) $(OBJS)