31 lines
		
	
	
	
		
			726 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			726 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
fmt:
 | 
						|
	clang-format -i src/**
 | 
						|
 | 
						|
check-format:
 | 
						|
	clang-format -i src/** --dry-run
 | 
						|
 | 
						|
# the lint ends up running over a large amount of llvm surface area and it takes considerably
 | 
						|
# longer than the extra build time from using release mode
 | 
						|
lint: release
 | 
						|
	clang-tidy src/**.cpp --load=build/release/libtidyfox.so
 | 
						|
 | 
						|
build:
 | 
						|
	cmake -GNinja -B build/debug \
 | 
						|
		-DCMAKE_BUILD_TYPE=Debug \
 | 
						|
		-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
 | 
						|
 | 
						|
	ln -sf build/debug/compile_commands.json compile_commands.json
 | 
						|
	cmake --build build/debug
 | 
						|
 | 
						|
release:
 | 
						|
	cmake -GNinja -B build/release \
 | 
						|
		-DCMAKE_BUILD_TYPE=Release \
 | 
						|
		-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
 | 
						|
 | 
						|
	cmake --build build/release
 | 
						|
 | 
						|
clean:
 | 
						|
	rm -rf build
 | 
						|
	rm -f compile_commands.json
 | 
						|
 | 
						|
pre-commit: check-format lint
 |