-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 844 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 844 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
34
35
36
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.Version=$(VERSION)"
MODULE := github.com/nicolasacchi/ebcli
BINARY := ebcli
.PHONY: build test lint clean release install
build:
go build $(LDFLAGS) -o $(BINARY) .
install:
go install $(LDFLAGS) .
test:
go test ./...
test-v:
go test -v ./...
lint:
golangci-lint run
clean:
rm -f $(BINARY)
rm -rf dist/
release: clean
@mkdir -p dist
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-linux-amd64 .
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o dist/$(BINARY)-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o dist/$(BINARY)-darwin-arm64 .
@echo "Built binaries in dist/"
@ls -lh dist/
.DEFAULT_GOAL := build