Makefile targets for linting
This commit is contained in:
		
							parent
							
								
									fe00d47e02
								
							
						
					
					
						commit
						8c8930f5c5
					
				
					 1 changed files with 13 additions and 1 deletions
				
			
		| 
						 | 
					@ -3,6 +3,7 @@ CXXFLAGS = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast
 | 
				
			||||||
#CXXFLAGS += -Werror
 | 
					#CXXFLAGS += -Werror
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SRC = $(wildcard *.cc)
 | 
					SRC = $(wildcard *.cc)
 | 
				
			||||||
 | 
					HDR = $(wildcard *.h)
 | 
				
			||||||
OBJ = $(SRC:.cc=.o)
 | 
					OBJ = $(SRC:.cc=.o)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: spell edit $(OBJ)
 | 
					all: spell edit $(OBJ)
 | 
				
			||||||
| 
						 | 
					@ -19,7 +20,18 @@ spell: spell.o word.o dictionary.o
 | 
				
			||||||
	@echo "Building $@"
 | 
						@echo "Building $@"
 | 
				
			||||||
	@$(CXX) -c $(CXXFLAGS) $< -o $@
 | 
						@$(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:
 | 
					clean:
 | 
				
			||||||
	rm -f *.o spell edit
 | 
						rm -f *.o spell edit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: clean
 | 
					.PHONY: clean all lint clang-tidy cppcheck clang-format
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue