]> ruderich.org/simon Gitweb - safcm/safcm.git/blob - Makefile
5549539245c535c6d0e92d7022ea531622a83e3a
[safcm/safcm.git] / Makefile
1 LDFLAGS = '\
2     -X "main.versionGit=$(shell git describe --long --tags --dirty --always)" \
3     -X "main.versionGo=$(shell go version)" \
4 '
5 # Build with `make GOFLAGS=` if -race is not supported
6 GOFLAGS=-race
7
8
9 all: safcm
10
11 safcm:
12         go fmt ./...
13         cd cmd/safcm-remote && ./build.sh
14         go build $(GOFLAGS) -ldflags $(LDFLAGS) ruderich.org/simon/safcm/cmd/safcm
15         @# For proper permissions after initial clone with a strict umask
16         cd cmd/safcm/testdata/project && ../../../../safcm fixperms 2> /dev/null
17
18 test:
19         ./cmd/safcm/testdata/ssh/prepare.sh
20         go vet ./...
21         go test $(GOFLAGS) ./...
22
23 clean:
24         rm -rf remote/helpers/
25         rm -f safcm
26         rm -f cmd/safcm/testdata/ssh/ssh/authorized_keys
27         rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519
28         rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519.pub
29         rm -f cmd/safcm/testdata/ssh/ssh/known_hosts
30         rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key
31         rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key.pub
32
33 .PHONY: all test clean safcm