Add make.sh

This commit is contained in:
augustin64 2022-03-21 17:18:49 +01:00
parent 3c496f9129
commit 41fceddb58

18
make.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
if [[ $1 == "preview" ]]; then
[[ $2 ]] || set -- "$1" "build"
if [[ $2 == "build" ]]; then
mkdir -p out
gcc src/preview_mnist.c -o out/preview_mnist
exit
elif [[ $2 == "train" ]]; then
[[ -f out/preview_mnist ]] || $0 preview build
out/preview_mnist data/train-images-idx3-ubyte data/train-labels-idx1-ubyte
exit
elif [[ $2 == "t10k" ]]; then
[[ -f out/preview_mnist ]] || $0 preview build
out/preview_mnist data/t10k-images-idx3-ubyte data/t10k-labels-idx1-ubyte
exit
fi
fi