-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (25 loc) · 671 Bytes
/
Makefile
File metadata and controls
39 lines (25 loc) · 671 Bytes
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
# Makefile for multi-currency example
# Test-related files
TPROG := testMoney
TSRC := MEtest.cpp
# Product-related files
SRC := Bank.cpp Expr.cpp
INC := Money.h Expr.h Bank.h
# Shouldn't change anything below here
OBJ=$(SRC:.cpp=.o)
TOBJ=$(TSRC:.cpp=.o)
GTEST_BASE_DIR=../gtest
GTEST_INC_DIR=$(GTEST_BASE_DIR)/include
GTEST_LIB_DIR=$(GTEST_BASE_DIR)/lib
IFLAG=-I$(GTEST_INC_DIR)
LFLAG=-L$(GTEST_LIB_DIR)
GTEST_LIB=-lgtest
GTEST_MAIN_LIB=-lgtest_main
CXXFLAGS=$(DFLAG) $(IFLAG)
.PHONY : test all clean
test: all
./$(TPROG)
all: $(TPROG)
$(TPROG) : $(TOBJ) $(OBJ)
$(CXX) -o $@ $^ $(LFLAG) $(GTEST_LIB) $(GTEST_MAIN_LIB) -pthread
MEtest.o: MEtest.cpp $(INC)