Skip to content

Commit

Permalink
Add lint check with clang-tidy as make target
Browse files Browse the repository at this point in the history
  • Loading branch information
Lai-YT committed Feb 22, 2024
1 parent e76485e commit 1d94f7c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ endif
# Export variable to be visible for test/Makefile.
export PARALLEL

OBJS := $(shell find . -name "*.cpp") lex.yy.o y.tab.o
SRC := $(shell find -name "*.cpp")
INC := $(shell find -name "*.hpp")

OBJS := $(SRC) lex.yy.o y.tab.o
OBJS := $(OBJS:.cpp=.o)
DEPS = $(OBJS:.o=.d)

.PHONY: all clean test
.PHONY: all clean test tidy

all: $(TARGET)

Expand All @@ -48,6 +51,9 @@ y.tab.cpp: parser.y

main.o: %.o: %.cpp y.tab.hpp

tidy:
clang-tidy $(CLANG_TIDY_FLAGS) -p . $(SRC) $(INC) -- $(CXXFLAGS)

clean:
rm -rf *.s *.o lex.yy.* y.tab.* *.output *.ssa $(TARGET) $(OBJS) $(DEPS)
cd test/ && $(MAKE) clean
Expand Down

0 comments on commit 1d94f7c

Please sign in to comment.