-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 879 Bytes
/
Makefile
File metadata and controls
38 lines (29 loc) · 879 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
37
.PHONY: build build-all clean install test
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.version=$(VERSION)"
# Build for current platform
build:
go build $(LDFLAGS) -o opencore .
# Build for all platforms
build-all: clean
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o build/opencore-windows-amd64.exe .
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o build/opencore-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o build/opencore-darwin-arm64 .
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o build/opencore-linux-amd64 .
# Clean build artifacts
clean:
rm -rf build/
rm -f opencore opencore.exe
# Install locally
install:
go install $(LDFLAGS) .
# Run tests
test:
go test -v ./...
# Run linter
lint:
golangci-lint run
# Download dependencies
deps:
go mod download
go mod tidy