-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (17 loc) · 695 Bytes
/
Makefile
File metadata and controls
24 lines (17 loc) · 695 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
CC = g++
CFLAGS = -std=c++17 -Iinclude -Ithirdparty/span-lite/include -Dspan_FEATURE_MAKE_SPAN -g
TARGETS_DIR = examples/
TARGETS = $(patsubst %.cpp, %, $(shell find $(TARGETS_DIR) -name '*.cpp'))
TEST_LIBS = -lgmock -lgtest -lgtest_main -lpthread -L/usr/lib
TEST_CXX_FLAGS = -std=c++17 -Iinclude -Ithirdparty/span-lite/include -Dspan_FEATURE_MAKE_SPAN -g
TEST_DIR = test/
TEST_TARGETS := $(patsubst %.cpp, %, $(shell find $(TEST_DIR) -name '*_test.cpp'))
%.o: %.cpp
$(CC) -c -o $@ $< $(CFLAGS)
$(TARGETS): %: %.cpp
$(CC) -o $@ $^ $(CFLAGS)
$(TEST_TARGETS): % : %.cpp
$(CC) $(TEST_CXX_FLAGS) -o $@ $< $(TEST_LIBS)
tests: $(TEST_TARGETS)
clean:
rm -f $(OBJ) $(TARGETS) $(TEST_TARGETS)