-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 2.66 KB
/
Makefile
File metadata and controls
49 lines (38 loc) · 2.66 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
.PHONY: check-deps test-all deps typecheck test run dev build clean
# ── Dashboard (TypeScript/React) ─────────────────────────────────────
deps:
@command -v node >/dev/null 2>&1 || { echo "Node.js not found — install from https://nodejs.org/"; exit 1; }
@[ -d node_modules ] || npm install
typecheck: deps
npx tsc --noEmit
test: deps
npx vitest run --reporter=verbose
# Production: build server + client, then serve from Express
run: deps build
node dist/server/index.js
# Development: Express API + Vite dev server (HMR on :5173, API proxy to :3000)
dev: deps
npx tsx src/server/index.ts & VITE_PID=$$!; npx vite --config vite.config.ts; kill $$VITE_PID 2>/dev/null || true
build: deps
npm run build
clean:
rm -rf dist
# ── Cross-project ────────────────────────────────────────────────────
check-deps:
@echo "Checking dependencies..."
@echo ""
@printf " Rust/Cargo ... " && (command -v cargo >/dev/null 2>&1 && cargo --version 2>/dev/null || echo "NOT FOUND — install from https://rustup.rs")
@printf " Zig .......... " && (command -v zig >/dev/null 2>&1 && zig version 2>/dev/null || echo "NOT FOUND — install from https://ziglang.org/download/")
@printf " Perl ......... " && (command -v perl >/dev/null 2>&1 && perl -v 2>/dev/null | grep 'version' | head -1 || echo "NOT FOUND — install from https://www.perl.org/get.html")
@printf " Python 3 .... " && (command -v python3 >/dev/null 2>&1 && python3 --version 2>/dev/null || echo "NOT FOUND — install from https://www.python.org/downloads/")
@printf " pytest ....... " && (python3 -c "import pytest; print(pytest.__version__)" 2>/dev/null || echo "NOT FOUND — install with: pip3 install pytest")
@printf " Go ........... " && (command -v go >/dev/null 2>&1 && go version 2>/dev/null || /usr/local/go/bin/go version 2>/dev/null || echo "NOT FOUND — install from https://go.dev/dl/")
@printf " Node.js ...... " && (command -v node >/dev/null 2>&1 && node --version 2>/dev/null || echo "NOT FOUND — install from https://nodejs.org/")
@echo ""
test-all:
@echo "=== CashRegister (Rust) ===" && $(MAKE) -C CashRegister test && echo ""
@echo "=== MissingNumber (Zig) ===" && $(MAKE) -C MissingNumber test && echo ""
@echo "=== MorseCode (Perl) ===" && $(MAKE) -C MorseCode test && echo ""
@echo "=== OnScreenKeyboard (Python) ===" && $(MAKE) -C OnScreenKeyboard test && echo ""
@echo "=== GildedRose (Go) ===" && $(MAKE) -C GildedRose test && echo ""
@echo "=== Dashboard (TypeScript/React) ===" && $(MAKE) test && echo ""