-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (43 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
57 lines (43 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
.PHONY: help build test clean rebuild format wasm wasm-clean serve demo
BUILD_DIR := build
WASM_BUILD_DIR := build-wasm
CLANG_FORMAT ?= clang-format
.DEFAULT_GOAL := build
help:
@echo "midi-sketch Build System"
@echo ""
@echo " make build - Build the project"
@echo " make test - Run tests"
@echo " make clean - Clean build"
@echo " make rebuild - Clean and rebuild"
@echo " make format - Format code"
@echo " make wasm - Build WASM module"
@echo " make wasm-clean- Clean WASM build"
@echo " make serve - Start demo server (no build)"
@echo " make demo - Build WASM and start demo server"
configure:
@mkdir -p $(BUILD_DIR)
@cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release
build: configure
cmake --build $(BUILD_DIR) --parallel
test: build
ctest --test-dir $(BUILD_DIR) --output-on-failure
clean:
rm -rf $(BUILD_DIR)
rebuild: clean build
format:
@find src tests -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" \) | xargs $(CLANG_FORMAT) -i
wasm-configure:
emcmake cmake -B $(WASM_BUILD_DIR) -DBUILD_WASM=ON -DCMAKE_BUILD_TYPE=Release
wasm: wasm-configure
cmake --build $(WASM_BUILD_DIR) --parallel
@ls -lh dist/*.wasm dist/*.js 2>/dev/null || echo "WASM files not found"
yarn build:js
wasm-clean:
rm -rf $(WASM_BUILD_DIR)
rm -rf dist/*.wasm dist/*.js
serve:
@echo "Starting demo server at http://localhost:8080/demo/"
@echo "Press Ctrl+C to stop"
python3 -m http.server 8080
demo: wasm serve