-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (35 loc) · 1.13 KB
/
Makefile
File metadata and controls
45 lines (35 loc) · 1.13 KB
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
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
CUR_DIR = .
SRC_DIR = $(CUR_DIR)/src
LIB_DIR = $(CUR_DIR)/lib
OBJ_DIR = $(CUR_DIR)/.obj
# Flags passed to the preprocessor.
# Set Google Test's header directory as a system directory, such that
# the compiler doesn't generate warnings in Google Test headers.
CPPFLAGS += -isystem $(CUR_DIR)/include
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra
LDFLAGS += -L$(LIB_DIR) -lpthread -lgtest_main
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = system_call_test
# All Google Test headers.
GTEST_HEADERS = $(CUR_DIR)/include/gtest/*.h \
$(CUR_DIR)/include/gtest/internal/*.h
all :
make -C common/gtest
make $(TESTS)
mkdir -p $(OBJ_DIR)
mv *.o $(OBJ_DIR)
clean :
make clean -C common/gtest
rm -rf $(TESTS) $(OBJ_DIR)
system_call_test.o : $(SRC_DIR)/system_call_test.cc #$(GTEST_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $^
system_call_test: system_call_test.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $^ -o $@