diff --git a/makefile b/makefile index 14bc985..3942568 100644 --- a/makefile +++ b/makefile @@ -1,12 +1,22 @@ -.PHONY: clean build run +.PHONY: check clean build run DEFAULT: run +format: + @gofmt -s -w . + +check: + @test -z $$(gofmt -l .) || \ + (echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1) + clean: @find -type f -name "*.log" -exec rm '{}' \; build: - @go build -v . + @go build -ldflags="-s -w" -v . run: clean build @./cairde + +loc: + @find . -name "*.go" | xargs wc -l