]> ruderich.org/simon Gitweb - safcm/safcm.git/blob - Makefile
frontend: add Loop.HostSyncMsg()
[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
16 test:
17         @# For proper permissions after initial clone with a strict umask
18         cd cmd/safcm/testdata/project && ../../../../safcm fixperms 2> /dev/null
19         @#
20         ./cmd/safcm/testdata/ssh/prepare.sh
21         go vet ./...
22         go test $(GOFLAGS) ./...
23
24 lint:
25         shellcheck ci/run
26         shellcheck cmd/safcm-remote/build.sh
27         shellcheck cmd/safcm/testdata/ssh/prepare.sh
28
29 clean:
30         rm -rf cmd/safcm/remote/
31         rm -f safcm
32         rm -f cmd/safcm/testdata/ssh/ssh/authorized_keys
33         rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519
34         rm -f cmd/safcm/testdata/ssh/ssh/id_ed25519.pub
35         rm -f cmd/safcm/testdata/ssh/ssh/known_hosts
36         rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key
37         rm -f cmd/safcm/testdata/ssh/sshd/ssh_host_key.pub
38         rm -rf cmd/safcm/testdata/ssh/project/no-changes.example.org/
39
40 .PHONY: all test clean safcm