-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (36 loc) · 1.34 KB
/
Makefile
File metadata and controls
42 lines (36 loc) · 1.34 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
.PHONY: setup build clean help run
help: ## Show this help message
@echo 'Usage: make [target]'
@echo
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## Build the project
@echo "Building project..."
@mkdir -p build && cd build && cmake .. && make
@if [ -f "build/mnist" ]; then \
echo "Build successful! Run the demo with: ./build/mnist after running: make setup"; \
elif [ -f "build/src/mnist" ]; then \
echo "Build successful! Run the demo with: ./build/src/mnist after running: make setup"; \
else \
echo "Build completed, but mnist executable not found at expected location."; \
fi
run: build ## Build and run the mnist application
@if [ -f "build/mnist" ]; then \
./build/mnist; \
elif [ -f "build/src/mnist" ]; then \
./build/src/mnist; \
else \
echo "Error: mnist executable not found after build"; \
exit 1; \
fi
setup: ## Setup project
@echo "Setting up project..."
@cd data && ./download.sh
clean: ## Clean up files
@echo "Cleaning up..."
@if [ -d "data" ]; then \
cd data/ && rm -rf t10k-images.idx3-ubyte t10k-labels.idx1-ubyte train-images.idx3-ubyte train-labels.idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte train-images-idx3-ubyte train-labels-idx1-ubyte; \
fi
@rm -rf build
@rm -rf test/build
.DEFAULT_GOAL := help