build: borrow abra targets, use LDFLAGS on build

This commit is contained in:
decentral1se 2023-10-01 09:51:06 +02:00
parent d2b35464e8
commit b78d4099ea
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 12 additions and 2 deletions

View File

@ -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