-
Notifications
You must be signed in to change notification settings - Fork 133
/
Makefile
39 lines (29 loc) · 950 Bytes
/
Makefile
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
.PHONY: clean all test doc lint show_docs
all: bin/mock
LDFLAGS =
CFLAGS = -Wall -O3 -Iinclude -Icontrib
CXXFLAGS = -std=c++11 $(CFLAGS)
SRC = $(wildcard contrib/*.cc contrib/*.c)
ALL_CXX_OBJ = $(patsubst contrib/%.cc, build/%.o, $(SRC))
ALL_C_OBJ = $(patsubst contrib/%.c, build/%.o, $(SRC))
ALL_OBJ = $(ALL_CC_OBJ) $(ALL_CXX_OBJ)
doc:
doxygen docs/Doxyfile
$(MAKE) -C docs html
show_docs:
@python3 -m http.server --directory docs/build/latest
lint:
./tests/scripts/task_lint.sh
build/%.o: contrib/%.cc
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CXX) -c $(CXXFLAGS) -c $< -o $@
build/%.o: contrib/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CC) -c $(CFLAGS) -c $< -o $@
bin/mock: $(ALL_OBJ)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
clean:
$(RM) -rf build */*/*/*~ */*.o */*/*.o */*/*/*.o */*.d */*/*.d */*/*/*.d docs/build docs/doxygen