Makefile lab3
This commit is contained in:
parent
c5e034c3ac
commit
cc34c03648
1 changed files with 33 additions and 0 deletions
33
lab3/Makefile
Normal file
33
lab3/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
CXX = g++
|
||||||
|
CXXFLAGS = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -std=c++17
|
||||||
|
#CXXFLAGS += -Werror
|
||||||
|
|
||||||
|
SRC = $(wildcard *.cc)
|
||||||
|
HDR = $(wildcard *.h)
|
||||||
|
OBJ = $(SRC:.cc=.o)
|
||||||
|
|
||||||
|
all: tabletest $(OBJ)
|
||||||
|
|
||||||
|
tabletest: $(OBJ)
|
||||||
|
@echo "Building & linking $@"
|
||||||
|
@$(CXX) $(CXXFLAGS) $^ -o $@
|
||||||
|
|
||||||
|
%.o:%.cc
|
||||||
|
@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 all lint clang-tidy cppcheck clang-format
|
Loading…
Reference in a new issue