2021-06-26 05:42:59 +00:00
|
|
|
#!/bin/sh
|
2021-04-15 18:40:40 +00:00
|
|
|
|
2022-02-12 23:06:47 +00:00
|
|
|
# copy default config if none
|
|
|
|
if [ ! -e config.h ]; then
|
|
|
|
cp config.def.h config.h
|
|
|
|
fi
|
|
|
|
|
2022-02-13 01:23:42 +00:00
|
|
|
# ensure sane environment
|
|
|
|
|
|
|
|
if [ ! -d inc ]; then
|
|
|
|
mkdir inc
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e inc/meta.nav.htm ]; then
|
|
|
|
touch inc/meta.nav.htm
|
|
|
|
fi
|
|
|
|
|
2021-04-15 18:40:40 +00:00
|
|
|
# Lint
|
2022-02-12 23:06:47 +00:00
|
|
|
clang-format -i main.c config.h
|
2021-04-15 18:40:40 +00:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -f ./main
|
|
|
|
|
|
|
|
# Linux(debug)
|
2022-02-12 23:06:47 +00:00
|
|
|
# cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wuninitialized -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined main.c -o main
|
2021-04-15 18:40:40 +00:00
|
|
|
|
|
|
|
# Linux(fast)
|
2022-02-12 23:06:47 +00:00
|
|
|
cc main.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o main
|
2021-04-15 18:40:40 +00:00
|
|
|
|
|
|
|
# RPi
|
|
|
|
# tcc -Wall main.c -o main
|
|
|
|
|
|
|
|
# Plan9
|
|
|
|
# pcc main.c -o main
|
|
|
|
|
|
|
|
# Valgrind
|
|
|
|
# gcc -std=c89 -DDEBUG -Wall -Wpedantic -Wshadow -Wuninitialized -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og main.c -o main
|
|
|
|
# valgrind ./main
|
|
|
|
|
|
|
|
# Build Size
|
|
|
|
# echo "$(du -b ./main | cut -f1) bytes written"
|
|
|
|
|
|
|
|
# Run
|
2021-06-26 05:42:59 +00:00
|
|
|
if [ "$1" = "-t" ]; then
|
|
|
|
shift && ./tw.sh $@
|
|
|
|
fi
|
2021-04-15 18:40:40 +00:00
|
|
|
./main
|
2022-06-05 16:44:47 +00:00
|
|
|
exitstatus=$?
|
|
|
|
if [ "${exitstatus}" = "0" ]; then
|
|
|
|
./thumbnailer.sh build &
|
|
|
|
fi
|
2021-04-15 18:40:40 +00:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -f ./main
|
2022-06-05 16:44:47 +00:00
|
|
|
|
|
|
|
exit ${exitstatus}
|