-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (42 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
52 lines (42 loc) · 1.51 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
BIN := bin
BIN_NAME := signls
GOLANG_BIN := go
CGO_ENABLED := 1
GOLANG_OS := linux
GOLANG_ARCH := amd64
GOLANG_BUILD_OPTS += GOOS=$(GOLANG_OS)
GOLANG_BUILD_OPTS += GOARCH=$(GOLANG_ARCH)
GOLANG_BUILD_OPTS += CGO_ENABLED=$(CGO_ENABLED)
GOLANG_LINT := $(BIN)/golangci-lint
GORELEASER := github.com/goreleaser/goreleaser/v2@latest
ASEQDUMP_BIN := aseqdump -p 14:0 | ts '[%H:%M:%.S]'
ASEQDUMP_NO_CLOCK_OPTS := | grep -v Clock
# GR_TARGET selects which goreleaser builds run (see .goreleaser.yaml). Default
# to the host so `make snapshot` builds a local binary.
HOST_OS := $(shell go env GOOS)
HOST_ARCH := $(shell go env GOARCH)
ifeq ($(HOST_OS),darwin)
GR_TARGET ?= darwin
else
GR_TARGET ?= $(HOST_OS)-$(HOST_ARCH)
endif
$(BIN):
mkdir -p $(BIN)
$(GOLANG_LINT): $(BIN)
GOBIN=$$(pwd)/$(BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
build: $(BIN)
$(GOLANG_BUILD_OPTS) $(GOLANG_BIN) build -o $(BIN)/$(BIN_NAME)
chmod +x $(BIN)/$(BIN_NAME)
# Build a local release snapshot (archives in dist/) for the host target.
snapshot:
GR_TARGET=$(GR_TARGET) $(GOLANG_BIN) run $(GORELEASER) release --snapshot --clean
checks: $(GOLANG_LINT)
$(GOLANG_LINT) run ./...
test:
$(GOLANG_BIN) test ./...
bench:
$(GOLANG_BIN) test -bench=. -benchmem ./...
monitor-midi:
$(ASEQDUMP_BIN) $(ASEQDUMP_NO_CLOCK_OPTS)
monitor-midi-clock:
$(ASEQDUMP_BIN)