X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=Makefile;h=f4cc011e6aa6abdab01f603e4d50d3193e54b8a0;hb=64a43bef32b144ce9894815a92f7083306f7ef1e;hp=8ccec9daa1fa3489f6d46ac19396a1ff62b8e2ad;hpb=f2f2bc47e8729548f3c10117f7f008b547c4afc5;p=safcm%2Fsafcm.git diff --git a/Makefile b/Makefile index 8ccec9d..f4cc011 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,26 @@ +LDFLAGS = '\ + -X "main.versionGit=$(shell git describe --long --tags --dirty --always)" \ + -X "main.versionGo=$(shell go version)" \ +' +# Build with `make GOFLAGS=` if -race is not supported +GOFLAGS=-race + + all: safcm safcm: go fmt ./... cd cmd/safcm-remote && ./build.sh - go build -race ruderich.org/simon/safcm/cmd/safcm + go build $(GOFLAGS) -ldflags $(LDFLAGS) ruderich.org/simon/safcm/cmd/safcm @# For proper permissions after initial clone with a strict umask cd cmd/safcm/testdata/project && ../../../../safcm fixperms 2> /dev/null +test: + go vet ./... + go test $(GOFLAGS) ./... + clean: rm -rf remote/helpers/ rm -f safcm -.PHONY: all clean safcm +.PHONY: all test clean safcm