add tidy target to the Makefile for clang-tidy

This commit is contained in:
Daniel Micay 2018-10-14 18:01:40 -04:00
parent b66ca56ba1
commit 118549451b

View File

@ -5,10 +5,12 @@ SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text
OBJECTS := chacha.o malloc.o memory.o pages.o random.o util.o
SOURCES := chacha.c malloc.c memory.c pages.c random.c util.c
OBJECTS := $(SOURCES:.c=.o)
ifeq ($(CONFIG_CXX_ALLOCATOR),true)
LDLIBS += -lstdc++
SOURCES += new.cc
OBJECTS += new.o
endif
@ -23,5 +25,10 @@ pages.o: pages.c pages.h memory.h util.h
random.o: random.c random.h chacha.h util.h
util.o: util.c util.h
tidy:
clang-tidy $(SOURCES) -- $(CPPFLAGS)
clean:
rm -f hardened_malloc.so $(OBJECTS)
.PHONY: clean tidy