-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (24 loc) · 825 Bytes
/
Makefile
File metadata and controls
32 lines (24 loc) · 825 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
.PHONY: build clean install test
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.version=$(VERSION)"
build:
go build $(LDFLAGS) -o bin/todoist ./cmd/todoist
install:
go install $(LDFLAGS) ./cmd/todoist
clean:
rm -rf bin/
test:
go test -v ./...
# Quick run for development
run:
go run ./cmd/todoist $(ARGS)
# Fetch dependencies
deps:
go mod download
go mod tidy
# Build for all platforms
build-all:
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/todoist-darwin-amd64 ./cmd/todoist
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin/todoist-darwin-arm64 ./cmd/todoist
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/todoist-linux-amd64 ./cmd/todoist
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o bin/todoist-linux-arm64 ./cmd/todoist