-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (39 loc) · 1.02 KB
/
Copy pathMakefile
File metadata and controls
51 lines (39 loc) · 1.02 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
APP := LLMProxyAS
MODULE := LLMProxyAS
CMD := ./cmd/server
BIN_DIR := bin
GO ?= go
.PHONY: all build run tidy test clean docker-build docker-up docker-down docker-logs help
all: build
## build: compile server binary into bin/
build:
@mkdir -p $(BIN_DIR) 2>/dev/null || mkdir $(BIN_DIR) 2>nul || true
$(GO) build -o $(BIN_DIR)/$(APP)$(shell go env GOEXE) $(CMD)
## run: run server (loads configs/ by default)
run:
$(GO) run $(CMD)
## tidy: sync go.mod / go.sum
tidy:
$(GO) mod tidy
## test: run unit tests
test:
$(GO) test ./...
## clean: remove build artifacts
clean:
$(GO) clean
rm -rf $(BIN_DIR)
## docker-build: build container image
docker-build:
docker compose build
## docker-up: build and start container in background
docker-up:
docker compose up -d --build
## docker-down: stop and remove container
docker-down:
docker compose down
## docker-logs: follow container logs
docker-logs:
docker compose logs -f
## help: show targets
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //'