-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (54 loc) · 2.12 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
SRC_DIR = src
INCLUDE_DIR = include
BUILD_DIR = build
OUTPUT_DIR = output
EXECUTABLE_FILE = a.out
CC = g++
CFLAGS = -std=c++11 -I $(INCLUDE_DIR)
OBJECTS = $(BUILD_DIR)/main.o \
$(BUILD_DIR)/TrafficHandler.o \
$(BUILD_DIR)/Monitor.o \
$(BUILD_DIR)/Tools.o \
$(BUILD_DIR)/PathEdge.o \
$(BUILD_DIR)/Car.o
.PHONY: all build_objects make_output_dir make_build_dir clean
all: make_build_dir make_output_dir build_objects
build_objects: $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o $(EXECUTABLE_FILE) -lpthread -lrt
make_build_dir:
mkdir -p $(BUILD_DIR)
make_output_dir:
mkdir -p $(OUTPUT_DIR)
clean:
rm -rf $(BUILD_DIR) $(OUTPUT_DIR) *.o *.out
mainSensitivityList = $(SRC_DIR)/main.cpp \
$(INCLUDE_DIR)/TrafficHandler.hpp
TrafficHandlerSensitivityList = $(SRC_DIR)/TrafficHandler.cpp \
$(INCLUDE_DIR)/TrafficHandler.hpp \
$(INCLUDE_DIR)/Tools.hpp \
$(INCLUDE_DIR)/PathEdge.hpp \
$(INCLUDE_DIR)/constants.hpp \
$(INCLUDE_DIR)/Car.hpp
MonitorSensitivityList = $(SRC_DIR)/Monitor.cpp \
$(INCLUDE_DIR)/Monitor.hpp
ToolsSensitivityList = $(SRC_DIR)/Tools.cpp \
$(INCLUDE_DIR)/Tools.hpp
PathEdgeSensitivityList = $(SRC_DIR)/PathEdge.cpp \
$(INCLUDE_DIR)/PathEdge.hpp \
$(INCLUDE_DIR)/Monitor.hpp
CarSensitivityList = $(SRC_DIR)/Car.cpp \
$(INCLUDE_DIR)/Car.hpp \
$(INCLUDE_DIR)/constants.hpp \
$(INCLUDE_DIR)/Tools.hpp
$(BUILD_DIR)/main.o: $(mainSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/main.cpp -o $(BUILD_DIR)/main.o
$(BUILD_DIR)/TrafficHandler.o: $(TrafficHandlerSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/TrafficHandler.cpp -o $(BUILD_DIR)/TrafficHandler.o
$(BUILD_DIR)/Monitor.o: $(MonitorSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Monitor.cpp -o $(BUILD_DIR)/Monitor.o
$(BUILD_DIR)/Tools.o: $(ToolsSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Tools.cpp -o $(BUILD_DIR)/Tools.o
$(BUILD_DIR)/PathEdge.o: $(PathEdgeSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/PathEdge.cpp -o $(BUILD_DIR)/PathEdge.o
$(BUILD_DIR)/Car.o: $(CarSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Car.cpp -o $(BUILD_DIR)/Car.o