-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.35 KB
/
Copy pathMakefile
File metadata and controls
62 lines (47 loc) · 1.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
# Hakanai Makefile
# Build system for Rust workspace with integrated TypeScript compilation
# Variables
CARGO := cargo
.PHONY: all
all: build
.PHONY: build
build:
$(CARGO) build --workspace --verbose
.PHONY: build-wasm
build-wasm: check-wasm-pack clean-wasm
cd wasm && ./build.sh
.PHONY: check-npm
check-npm:
@which npm > /dev/null 2>&1 || (echo "Error: npm is not installed" && exit 1)
@which npx > /dev/null 2>&1 || (echo "Error: npx is not installed" && exit 1)
.PHONY: check-wasm-pack
check-wasm-pack:
@which wasm-pack > /dev/null 2>&1 || (echo "Warning: wasm-pack not installed. Install with: cargo install wasm-pack" && echo "Continuing without WASM support...")
.PHONY: build-ts
build-ts: clean-ts build-wasm
cd typescript && npm run build
.PHONY: release
release:
$(CARGO) build --release --workspace --verbose
# Test targets
.PHONY: test
test: test-rust test-ts
.PHONY: test-rust
test-rust:
$(CARGO) test --verbose
.PHONY: test-ts
test-ts: build-ts
cd typescript/tests && npm test
# Clean builds
.PHONY: clean
clean: clean-rust clean-ts clean-wasm
.PHONY: clean-rust
clean-rust:
$(CARGO) clean
.PHONY: clean-ts
clean-ts:
rm -rf server/includes/*.js server/includes/core server/includes/components server/includes/*.min.css
rm -rf typescript/tests/node_modules typescript/tests/coverage
.PHONY: clean-wasm
clean-wasm:
rm -rf server/includes/*.wasm