X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=Makefile;h=95cc9c86278b87d59d4b36ababfd3b685acb2753;hb=4e46a22dc5165611b254081597c65969c8c2ce39;hp=152ec8a21927a82c6057a686ca84fc123f70bc3a;hpb=0b1c52758ea780b5666a708d1977716b1387fc8e;p=safcm%2Fsafcm.git diff --git a/Makefile b/Makefile index 152ec8a..95cc9c8 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,16 +11,25 @@ all: safcm safcm: go fmt ./... cd cmd/safcm-remote && ./build.sh - go build -ldflags $(LDFLAGS) -race 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 + go build $(GOFLAGS) -ldflags $(LDFLAGS) ruderich.org/simon/safcm/cmd/safcm test: + @# For proper permissions after initial clone with a strict umask + cd cmd/safcm/testdata/project && ../../../../safcm fixperms 2> /dev/null + @# + ./cmd/safcm/testdata/ssh/prepare.sh go vet ./... - go test -race ./... + go test $(GOFLAGS) ./... clean: rm -rf remote/helpers/ rm -f safcm + rm -f cmd/safcm/testdata/ssh/ssh/authorized_keys + rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519 + rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519.pub + rm -f cmd/safcm/testdata/ssh/ssh/known_hosts + rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key + rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key.pub + rm -rf cmd/safcm/testdata/ssh/project/no-changes.example.org/ .PHONY: all test clean safcm