-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
85 lines (69 loc) · 2.03 KB
/
Makefile
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
# Zig Neural Network Project Makefile
# Configuration
ZIG ?= zig
BUILD_MODE ?= Debug
RELEASE_MODE ?= ReleaseSafe
# Directories
BUILD_DIR = zig-out
EXAMPLES_DIR = examples
# Default target
.PHONY: all
all: build test examples
# Build the project
.PHONY: build
build:
$(ZIG) build -Doptimize=$(BUILD_MODE)
# Run all tests
.PHONY: test
test:
$(ZIG) build test
$(ZIG) build test-acceptance
# Build and run all examples
.PHONY: examples
examples: example-simple-xor example-gated-network example-xor-training example-binary-classification example-regression example-network-visualization
# Individual examples
.PHONY: example-simple-xor
example-simple-xor:
@echo "Running Simple XOR example..."
$(ZIG) build run_simple_xor -Doptimize=$(BUILD_MODE)
.PHONY: example-gated-network
example-gated-network:
@echo "Running Gated Network example..."
$(ZIG) build run_gated_network -Doptimize=$(BUILD_MODE)
.PHONY: example-xor-training
example-xor-training:
@echo "Running XOR Training example..."
$(ZIG) build run_xor_training -Doptimize=$(BUILD_MODE)
.PHONY: example-binary-classification
example-binary-classification:
@echo "Running Binary Classification example..."
$(ZIG) build run_binary_classification -Doptimize=$(BUILD_MODE)
.PHONY: example-regression
example-regression:
@echo "Running Regression example..."
$(ZIG) build run_regression -Doptimize=$(BUILD_MODE)
.PHONY: example-network-visualisation
example-network-visualisation:
@echo "Running Network Visualisation example..."
$(ZIG) build run_network_visualisation -Doptimize=$(BUILD_MODE)
.PHONY: example-gpu
example-gpu:
@echo "Running GPU (auto) example..."
$(ZIG) build run_gpu -Dgpu=auto -Doptimize=$(BUILD_MODE)
.PHONY: example-gpu-metal
example-gpu-metal:
@echo "Running GPU (metal) example..."
$(ZIG) build run_gpu -Dgpu=metal -Doptimize=$(BUILD_MODE)
# Build release version
.PHONY: release
release:
$(ZIG) build -Doptimize=$(RELEASE_MODE)
# Clean build artifacts
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
rm -rf .zig-cache
# Development helpers
.PHONY: format
format:
$(ZIG) fmt .