-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (37 loc) · 1.41 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
BIN = bin
EXE = $(BIN)/testerApp.exe
OBJS = $(BIN)/RPNCalculator.o \
$(BIN)/Addition.o \
$(BIN)/Subtraction.o \
$(BIN)/Multiplication.o \
$(BIN)/Division.o \
$(BIN)/MathFactory.o \
$(BIN)/RPNCalculatorTest.o
LIBS = -pthread $(BIN)/libgtest.a
CPPFLAGS = -std=c++14 -pthread -fprofile-arcs -ftest-coverage
INC = -I googletest \
-I googletest/googletest/include \
-I googlemock \
-I googletest/googlemock/include \
-I src \
-I test
all: $(OBJS)
g++ -o $(EXE) $(OBJS) $(LIBS) $(CPPFLAGS)
$(EXE)
$(BIN)/RPNCalculator.o: src/RPNCalculator.cpp
g++ -c -o $(BIN)/RPNCalculator.o src/RPNCalculator.cpp $(CPPFLAGS) $(INC)
$(BIN)/RPNCalculatorTest.o: test/RPNCalculatorTest.cpp
g++ -c -o $(BIN)/RPNCalculatorTest.o test/RPNCalculatorTest.cpp $(CPPFLAGS) $(INC)
$(BIN)/Addition.o: src/Addition.cpp
g++ -c -o $(BIN)/Addition.o src/Addition.cpp $(CPPFLAGS) $(INC)
$(BIN)/Subtraction.o: src/Subtraction.cpp
g++ -c -o $(BIN)/Subtraction.o src/Subtraction.cpp $(CPPFLAGS) $(INC)
$(BIN)/Multiplication.o: src/Multiplication.cpp
g++ -c -o $(BIN)/Multiplication.o src/Multiplication.cpp $(CPPFLAGS) $(INC)
$(BIN)/Division.o: src/Division.cpp
g++ -c -o $(BIN)/Division.o src/Division.cpp $(CPPFLAGS) $(INC)
$(BIN)/MathFactory.o: src/MathFactory.cpp
g++ -c -o $(BIN)/MathFactory.o src/MathFactory.cpp $(CPPFLAGS) $(INC)
.PHONY: clean
clean:
rm -f $(BIN)/*.o $(BIN)/*.exe