blob: 1279cf21c1eea7e05a4f39751884563c6093ac6e (
plain)
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
|
# Settings
include prelude.mk
-include local.mk
RM_F = rm -f
RM_RF = rm -rf
ZIG = zig
# Main targets
.PHONY: all debug release watch run release format clean
all: debug release ## Check codebase and compile in debug mode
debug: ## Compile program in debug mode
@$(ZIG) build
@echo "[ZIG] zig-out"
watch: ## Watch and compile program in debug mode
@$(ZIG) build --watch
run: ## Compile and run program in debug mode
@$(ZIG) build run
release: ## Compile program in release mode
@for target in aarch64-linux-gnu aarch64-macos-none arm-linux-gnueabihf x86_64-linux-gnux32 x86_64-windows; do \
echo "[ZIG] zig-release/$${target}"; \
$(ZIG) build -p zig-release/$${target} -Dtarget=$${target} --release=small; \
done
SRCS = build.zig $(shell find src -name \*.zig)
format: ## Format source files
@echo "[FMT] $(SRCS)"
@find . -name \*.zig -exec '$(ZIG)' 'fmt' '{}' ';'
clean: ## Remove build files
@echo "[CLEAN] zig-out zig-release"
@$(RM_RF) -- zig-out zig-release
|