-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (34 loc) · 855 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
.DEFAULT_GOAL := do
CC = $(CXX)
CXX = clang++
CPPFLAGS += -g3 -MMD -MP -MF .dep/$(basename $(notdir $@)).d
CPPFLAGS += $(shell pkg-config --cflags libsodium)
CPPFLAGS += $(shell pkg-config --cflags openssl)
CXXFLAGS += -O2 -std=c++14 -Wall -Wextra
LDFLAGS += -g3
LOADLIBES += $(shell pkg-config --libs libsodium)
LOADLIBES += $(shell pkg-config --libs openssl)
####
%.out: %.o
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
.dep:
mkdir -p $@
.PHONY: do
do: .dep test_sodium_drbg.out test_openssl_aes_drbg.out
.PHONY: clean
clean:
$(RM) *.o *.out
.PHONY: check
check: do
set -xe; \
for t in $$(ls -1 test_*.out | grep -v __); do \
./$$t; \
done; \
set +xe
.PHONY: indent
indent:
which $(CLANG_FORMAT)
git ls-files | grep -i '\.[ch]pp' | xargs -n 1 $(CLANG_FORMAT) -style=file -i
ifneq ($(MAKECMDGOALS),clean)
-include $(shell ls .dep/*.d)
endif