forked from poseidonos/poseidonos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.rules
More file actions
36 lines (28 loc) · 795 Bytes
/
Makefile.rules
File metadata and controls
36 lines (28 loc) · 795 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
ifeq ($(CACHE), Y)
CC = ccache g++
else
CC = g++
endif
RM = rm
TEST_SRCS = $(filter %_stub.cpp, $(SRCS))
TEST_SRCS += $(filter %_mock.cpp, $(SRCS))
TEST_SRCS += $(filter %_fake.cpp, $(SRCS))
TEST_SRCS += $(filter %_test.cpp, $(SRCS))
TEST_SRCS += $(filter %_fixture.cpp, $(SRCS))
BUILD_SRCS = $(filter-out $(TEST_SRCS), $(SRCS))
OBJECTS = $(BUILD_SRCS:.cpp=.o)
TEST_OBJECTS = $(TEST_SRCS:.cpp=.o)
TEST_CPPFLAGS = $(CPPFLAGS) -lgmock -lyaml-cpp
all : $(OBJECTS) $(TEST_OBJECTS)
sam : $(OBJECTS)
%.o: %.cpp
@echo "Compiling [$(notdir $<)]..."
@$(CC) $(INCLUDE) $(CPPFLAGS) -MMD -MP $(DEFINE) -c $< -o $@
clean:
@echo "clean"
@find . -name "*.o" -delete
@find . -name "*.d" -delete
@find . -name "*.gcda" -delete
@find . -name "*.gcno" -delete
.PHONY:clean
-include $(OBJECTS:.o=.d)