diff --git a/lab2/Makefile b/lab2/Makefile index 48c8fe4..0b87009 100644 --- a/lab2/Makefile +++ b/lab2/Makefile @@ -3,6 +3,7 @@ CXXFLAGS = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast #CXXFLAGS += -Werror SRC = $(wildcard *.cc) +HDR = $(wildcard *.h) OBJ = $(SRC:.cc=.o) all: spell edit $(OBJ) @@ -19,7 +20,18 @@ spell: spell.o word.o dictionary.o @echo "Building $@" @$(CXX) -c $(CXXFLAGS) $< -o $@ +lint: clang-tidy cppcheck clang-format + +clang-tidy: + clang-tidy $(SRC) -- $(CXXFLAGS) + +cppcheck: + cppcheck --enable=all --language=c++ --std=c++17 --suppress=missingIncludeSystem -I/usr/include $(SRC) $(HDR) + +clang-format: + clang-format -i $(SRC) $(HDR) + clean: rm -f *.o spell edit -.PHONY: clean +.PHONY: clean all lint clang-tidy cppcheck clang-format