-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (29 loc) · 887 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
NAME = mattercheck
TARGET = dist/$(NAME)
DEPS = $(shell find . -type f -name '*.go')
LDFLAGS = -s -w
export GO111MODULE=on
build = GOOS=$(1) GOARCH=$(2) go build -ldflags "$(LDFLAGS)" -trimpath -o $(TARGET)_$(1)_$(2)$(3)
# build a local version for tests, simply run make
mattercheck: $(DEPS)
go build -ldflags "$(LDFLAGS)" -o $@
.PHONY: all
all: clean $(DEPS)
$(call build,darwin,amd64)
$(call build,freebsd,amd64)
$(call build,linux,amd64)
$(call build,linux,arm64)
$(call build,windows,amd64,.exe)
cd $(dir $(TARGET)) && sha256sum $(NAME)*
cd $(dir $(TARGET)) && xz -z9 $(NAME)*
.PHONY: install
install: $(DEPS)
go install -ldflags "$(LDFLAGS)" .
.PHONE: clean
clean:
rm -f mattercheck
rm -rf dist
.PHONY: update-fixture
update-fixture:
curl -fsSLo releases/testdata/version-archive.html \
https://docs.mattermost.com/about/version-archive.html