-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 798 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 798 Bytes
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
APPNAME := ipmi-checker
DIST_DIR := ./dist
PLATFORMS := linux-386 linux-amd64 linux-arm
RELEASE := $(shell git describe --all --always)
build:
go generate
go get -v -t ./...
go test -v ./...
go build -v
cleanup_dist:
rm -rfv $(DIST_DIR)
mkdir -p $(DIST_DIR)
dist: cleanup_dist $(PLATFORMS)
$(PLATFORMS):
$(eval GOOS := $(firstword $(subst -, ,$@)))
$(eval GOARCH := $(lastword $(subst -, ,$@)))
go generate
env GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(DIST_DIR)/$(APPNAME).$(RELEASE).$@
md5: dist
cd $(DIST_DIR) && md5sum $(APPNAME).$(RELEASE).* | tee MD5SUM
release: md5
go get github.com/tcnksm/ghr
if [ "x$$(git config --global --get github.token)" = "x" ]; then echo "Missing github.token in your git config"; fi
ghr -recreate -u crossengage $(RELEASE) $(DIST_DIR)