-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (70 loc) · 2.35 KB
/
Copy pathMakefile
File metadata and controls
96 lines (70 loc) · 2.35 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# ggml-stack -- developer task runner
#
# This project is managed with `uv`. Targets wrap the common dev loop:
# environment sync, tests, lint/format/typecheck, the CLI, and packaging.
UV ?= uv
PKG := ggml_stack
SRC := src
TESTS := tests
.DEFAULT_GOAL := build
.PHONY: help install lock test lint format format-check typecheck check \
build run info dry-run dist clean distclean reset
## Show this help
help:
@awk '/^## / { sub(/^## /, ""); desc = $$0; next } \
/^[a-zA-Z0-9_-]+:/ { name = $$1; sub(/:.*/, "", name); \
if (desc != "") { printf " \033[36m%-14s\033[0m %s\n", name, desc; desc = "" } next } \
{ desc = "" }' $(MAKEFILE_LIST)
# --- environment ----------------------------------------------------------
## Create/refresh the virtualenv with test extras (uv sync)
install:
@uv sync
## Re-resolve and update uv.lock
lock:
@uv lock
# --- quality --------------------------------------------------------------
## Run the test suite
test:
@uv run pytest
## Lint with ruff (no install needed via uvx)
lint:
@uvx ruff check $(SRC) $(TESTS)
## Auto-format with ruff
format:
@uvx ruff format $(SRC) $(TESTS)
## Check formatting without writing changes
format-check:
@uvx ruff format --check $(SRC) $(TESTS)
## Static type-check with mypy
typecheck:
@uvx mypy $(SRC)
## Run lint, format-check, and tests
check: lint format-check test
# --- CLI ------------------------------------------------------------------
## Fetch + build the engines; pass flags via ARGS="--engines llama --with-server"
build: install
@uv run ggml-stack build $(ARGS)
## Run the CLI; pass args via ARGS="build --dry-run"
run:
@uv run ggml-stack $(ARGS)
## Show staged archives under thirdparty/
info:
@uv run ggml-stack info
## Print the git/cmake command lines without executing
dry-run:
@uv run ggml-stack build --dry-run
# --- packaging ------------------------------------------------------------
## Build wheel and sdist into dist/
dist:
@uv build
# --- housekeeping ---------------------------------------------------------
## Remove build artifacts and caches
clean:
@rm -rf build dist wheels *.egg-info src/*.egg-info
@find . -type d -name __pycache__ -prune -exec rm -rf {} +
@find . -type d -name '.*_cache' -prune -exec rm -rf {} +
## Also remove the virtualenv
distclean: clean
@rm -rf .venv
## Remove everythin
reset: distclean