-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 854 Bytes
/
Makefile
File metadata and controls
34 lines (27 loc) · 854 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
32
33
BUILD_DIR=bin
BINARY_NAME=hashID
VERSION=$(shell git describe --tags --always)
.PHONY: clean
clean:
go clean
rm -f ${BUILD_DIR}/${BINARY_NAME}-*
.PHONY: vendor
vendor:
go mod vendor
.PHONY: updep
updep:
go get -u ./...
go mod tidy
.PHONY: lint
lint:
golangci-lint run ./...
.PHONY: test
test:
go test -v ./...
.PHONY: build
build:
mkdir -p ${BUILD_DIR}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BUILD_DIR}/${BINARY_NAME}-${VERSION}-amd64-linux cmd/hashid/main.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ${BUILD_DIR}/${BINARY_NAME}-${VERSION}-arm64-linux cmd/hashid/main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${BUILD_DIR}/${BINARY_NAME}-${VERSION}-amd64-darwin cmd/hashid/main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ${BUILD_DIR}/${BINARY_NAME}-${VERSION}-amd64.exe cmd/hashid/main.go