X-Git-Url: https://ruderich.org/simon/gitweb/?p=safcm%2Fsafcm.git;a=blobdiff_plain;f=Makefile;h=f4cc011e6aa6abdab01f603e4d50d3193e54b8a0;hp=ddde397b2ce427b5995cce8933a426332b17aa36;hb=5dca1e53d7fa0c2b7c15bbcec5654638727f9009;hpb=7557c0d7a00e9c73056ae202264893daf8533aa6 diff --git a/Makefile b/Makefile index ddde397..f4cc011 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ 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 @@ -9,12 +11,16 @@ all: safcm safcm: go fmt ./... cd cmd/safcm-remote && ./build.sh - go build -ldflags $(LDFLAGS) -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