-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 797 Bytes
/
Makefile
File metadata and controls
49 lines (35 loc) · 797 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
40
41
42
43
44
45
46
47
48
49
CPP=${CXX}
CC=${CC}
CFLAGS=-std=c++11 -Wall -g -DDEBUG
LINKS = -lgtest -lpthread -lstdc++
TESTOBJS = test/pair_unitest.o \
test/rbtree_unitest.o \
test/map_unitest.o \
test/vector_unittest.o \
test/utility_unitest.o \
test/type_traits_unittest.o \
test/algorithm_unittest.o \
main.o
TEST=a.out
VPATH = ./
INC=-I. \
-I./c++ \
-I./googletest/googletest/include
LIB=-L. \
-L./googletest/build/googlemock/gtest
all:clean $(TEST)
gtest:
git submodule init
git submodule update
mkdir googletest/build
cd googletest/build;cmake ..;make
$(TEST):$(TESTOBJS)
$(CPP) $(CFLAGS) $(LIB) $(TESTOBJS) -o $@ $(LINKS)
%.o:%.cpp
$(CPP) $(CFLAGS) $(INC) -c $< -o $@
%.o:%.c
$(CC) $(CFLAGS) $(INC) -c $< -o $@
clean:
rm -rf $(TESTOBJS)
rm -rf $(TEST)
rm -rf core