#!/bin/sh -e RELEASE_flags="-DNDEBUG -O2 -g0 -s" DEBUG_flags="-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined" LIN="uxncli $HOME/roms/uxnlin.rom" ASM="uxncli $HOME/roms/drifblim.rom" if [[ "$*" == *"--lint"* ]] then clang-format -i ulzdec.c clang-format -i ulzenc.c $LIN decoder.tal fi # Building cc ulzdec.c $DEBUG_flags -o ulzdec cc ulzenc.c $DEBUG_flags -o ulzenc $ASM ulzdec.tal ulzdec.rom # Make compressed file ./ulzenc example.txt a.ulz ./ulzdec a.ulz b.bin echo "" echo "c decoder:" echo "" cat b.bin echo "" echo "" echo "uxn decoder:" echo "" uxncli ulzdec.rom a.ulz b.bin && cat b.bin echo "" echo "" rm ./ulzdec rm ./ulzenc rm ./a.ulz rm ./b.bin rm ./ulzdec.rom rm *.sym