-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 691 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 691 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
SOURCES := Tuple_ut.cpp
# Objs are all the sources, with .cpp replaced by .o
OBJS := $(SOURCES:.cpp=.o)
CC := g++-8
CFLAGS := -ggdb3 -std=c++17
LIBDIRS := \
-L $(GTEST_LIB)
LFLAGS :=
LIBS := -lgtest -lgtest_main
INCLUDES := \
-I $(GTEST_INC)
all: unit_test run
# Compile the binary 't' by calling the compiler with cflags, lflags, and any libs (if defined) and the list of objects.
unit_test: $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS) $(LIBDIRS) $(LIBS)
# Get a .o from a .cpp by calling compiler with cflags and includes (if defined)
.cpp.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<
clean:
find . -name *.o -delete
find . -name unit_tests -delete
run : unit_test
./unit_test