-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
executable file
·38 lines (30 loc) · 1.04 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
# the compiler: gcc for C program, define as g++ for C++
CC = g++
# compiler flags:
# -g - this flag adds debugging information to the executable file
# -Wall - this flag is used to turn on most compiler warnings
CFLAGS = -g -Wall -std=c++17 -pthread
LFLAGS = -lstdc++fs
# The build target
TARGET = test_timer
OBJECTS = App.o test_timer.o Timer.o Cancellation.o SSThread.o ManagedTimer.o
BUILD = build
PROJECT_OUTPUT = $(BUILD)/$(TARGET)
.PHONY: run
run: clean all
./build/test_timer
all: $(OBJECTS) $(BUILD)
$(CC) $(CFLAGS) $(LFLAGS) $(OBJECTS) -o $(PROJECT_OUTPUT)
# g++ -std=c++17 -lstdc++fs test_timer.cpp -lstdc++fs -o test_timer
# $(OBJECTS): %.o: %.cpp
$(OBJECTS): App.cpp test_timer.cpp
$(CC) $(CFLAGS) -c SSThread.cpp -o SSThread.o
$(CC) $(CFLAGS) -c Cancellation.cpp -o Cancellation.o
$(CC) $(CFLAGS) -c ManagedTimer.cpp -o ManagedTimer.o
$(CC) $(CFLAGS) -c Timer.cpp -o Timer.o
$(CC) $(CFLAGS) -c App.cpp -o App.o
$(CC) $(CFLAGS) -c test_timer.cpp -o test_timer.o
clean:
$(RM) -rf $(BUILD) $(OBJECTS)
$(BUILD):
mkdir build