-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (55 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
70 lines (55 loc) · 1.45 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
64
65
66
67
68
69
70
APP_NAME=gptcode
APP_PATH=./cmd/gptcode
GOBIN?=$(shell go env GOBIN)
ifeq ($(GOBIN),)
GOBIN=$(HOME)/go/bin
endif
ML_DIR=ml/complexity_detection
.PHONY: all build install dev clean test evidence verify public-contract train-ml train-complexity install-ml
all: build
build:
@echo "-> Building $(APP_NAME)..."
@go build -o bin/$(APP_NAME) $(APP_PATH)
install: build
@echo "-> Installing $(APP_NAME) to $(GOBIN)..."
@mkdir -p $(GOBIN)
@cp bin/$(APP_NAME) $(GOBIN)/
@echo "-> Running gptcode setup..."
@$(GOBIN)/$(APP_NAME) setup
@echo "-> Done."
install-ml: install
@echo "-> Setting up ML models..."
@$(MAKE) train-complexity
@echo "-> ML models ready."
dev:
@echo "-> Running in dev mode..."
@go run $(APP_PATH)
clean:
@echo "-> Cleaning..."
@rm -rf bin/
@rm -rf $(ML_DIR)/venv
@rm -f $(ML_DIR)/models/*.json
test:
@echo "-> Running Go tests..."
@go test -short ./...
public-contract:
@./scripts/test-public-contract.sh
evidence:
@./scripts/verify-public-examples.sh
verify:
@echo "-> Checking Go formatting..."
@test -z "$$(gofmt -l $$(find . -name '*.go' -not -path './vendor/*'))"
@echo "-> Running go vet..."
@go vet ./...
@echo "-> Building CLI..."
@mkdir -p bin
@go build -o bin/gptcode $(APP_PATH)
@echo "-> Running test suite..."
@PATH="$(CURDIR)/bin:$$PATH" go test -short ./...
@$(MAKE) public-contract
@$(MAKE) evidence
# ML Training targets
train-ml:
@gptcode train
train-complexity:
@gptcode train complexity_detection