tipe/make.sh

21 lines
541 B
Bash
Raw Normal View History

2022-03-21 17:18:49 +01:00
#!/bin/bash
2022-03-25 19:19:57 +01:00
FLAGS="-std=c99 -lm"
2022-03-21 17:18:49 +01:00
if [[ $1 == "preview" ]]; then
[[ $2 ]] || set -- "$1" "build"
if [[ $2 == "build" ]]; then
mkdir -p out
2022-03-25 19:19:57 +01:00
gcc src/mnist/preview.c -o out/preview_mnist $FLAGS
2022-03-21 17:18:49 +01:00
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