-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (45 loc) · 1.71 KB
/
Copy pathMakefile
File metadata and controls
63 lines (45 loc) · 1.71 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
53
54
55
56
57
58
59
60
61
62
63
GO ?= go
BIN ?= bin/opencode-gateway
OUTPUT_DIR ?= dist
PREFIX ?= $(HOME)/.local
INSTALL_DIR ?= $(PREFIX)/bin
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || printf 'dev')
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || printf 'unknown')
BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS ?= -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.buildDate=$(BUILD_DATE)
.PHONY: fmt vet test contract integration race fuzz-smoke live-scenarios-test build install update uninstall check release-check package package-self-test
fmt:
$(GO) fmt ./...
vet:
$(GO) vet ./...
test:
$(GO) test -count=1 ./...
contract:
$(GO) test -count=1 ./internal/capture ./internal/codex ./internal/server
integration:
$(GO) test -count=1 ./internal/server
race:
$(GO) test -race ./...
FUZZTIME ?= 1s
fuzz-smoke:
FUZZTIME=$(FUZZTIME) ./scripts/fuzz-smoke.sh
live-scenarios-test:
./scripts/live-smoke-test.sh
./scripts/live-scenarios-test.sh
build:
mkdir -p bin
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o $(BIN) ./cmd/opencode-gateway
install:
GO="$(GO)" PREFIX="$(PREFIX)" INSTALL_DIR="$(INSTALL_DIR)" ./scripts/install.sh
update:
GO="$(GO)" PREFIX="$(PREFIX)" INSTALL_DIR="$(INSTALL_DIR)" ./scripts/update.sh
uninstall:
PREFIX="$(PREFIX)" INSTALL_DIR="$(INSTALL_DIR)" ./scripts/uninstall.sh
check: fmt vet test race build
git diff --check
release-check: fmt vet test contract integration race build fuzz-smoke
git diff --check
package:
GO="$(GO)" VERSION="$(VERSION)" COMMIT="$(COMMIT)" OUTPUT_DIR="$(OUTPUT_DIR)" ./scripts/package-release.sh
package-self-test:
GO="$(GO)" VERSION="$(VERSION)" COMMIT="$(COMMIT)" OUTPUT_DIR="$(OUTPUT_DIR)" ./scripts/package-release.sh --self-test