-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
75 lines (57 loc) · 1.92 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
CC = g++
BUILD_DIR = build
SRC_DIR = src
INCLUDE_DIR = include
CFLAGS = -std=c++11 -Wall -Werror -I$(INCLUDE_DIR)
EXECUTABLE_FILE = Scheduler.out
OBJECTS = \
$(BUILD_DIR)/CommandHandler.o \
$(BUILD_DIR)/Core.o \
$(BUILD_DIR)/Main.o \
$(BUILD_DIR)/Process.o \
$(BUILD_DIR)/Thread.o \
$(BUILD_DIR)/ThreadScheduler.o \
CommandHandlerSensitivityList = \
$(SRC_DIR)/CommandHandler.cpp \
CoreSensitivityList = \
$(SRC_DIR)/Core.cpp \
$(INCLUDE_DIR)/Core.h \
$(INCLUDE_DIR)/Thread.h \
ProcessSensitivityList = \
$(SRC_DIR)/Process.cpp \
$(INCLUDE_DIR)/Process.h \
$(INCLUDE_DIR)/Thread.h \
$(INCLUDE_DIR)/ThreadScheduler.h \
$(INCLUDE_DIR)/Core.h
ThreadSchedulerSensitivityList = \
$(SRC_DIR)/ThreadScheduler.cpp\
$(INCLUDE_DIR)/ThreadScheduler.h \
$(INCLUDE_DIR)/Process.h \
$(INCLUDE_DIR)/Thread.h \
$(INCLUDE_DIR)/Core.h
ThreadSensitivityList = \
$(SRC_DIR)/Thread.cpp \
$(INCLUDE_DIR)/Thread.h
MainSensitivityList = \
$(SRC_DIR)/Main.cpp \
$(INCLUDE_DIR)/CommandHandler.h
all: $(BUILD_DIR) $(EXECUTABLE_FILE)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/CommandHandler.o: $(CommandHandlerSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/CommandHandler.cpp -o $(BUILD_DIR)/CommandHandler.o
$(BUILD_DIR)/Core.o: $(CoreSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Core.cpp -o $(BUILD_DIR)/Core.o
$(BUILD_DIR)/Process.o: $(ProcessSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Process.cpp -o $(BUILD_DIR)/Process.o
$(BUILD_DIR)/ThreadScheduler.o: $(ThreadSchedulerSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/ThreadScheduler.cpp -o $(BUILD_DIR)/ThreadScheduler.o
$(BUILD_DIR)/Thread.o: $(ThreadSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Thread.cpp -o $(BUILD_DIR)/Thread.o
$(BUILD_DIR)/Main.o: $(MainSensitivityList)
$(CC) $(CFLAGS) -c $(SRC_DIR)/Main.cpp -o $(BUILD_DIR)/Main.o
$(EXECUTABLE_FILE): $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o $(EXECUTABLE_FILE)
.PHONY: clean
clean:
rm -rf $(BUILD_DIR) *.o *.out