mirror of
https://github.com/cc65/cc65.git
synced 2024-08-21 01:29:34 +00:00
37 lines
559 B
Bash
37 lines
559 B
Bash
#!/usr/bin/env bash
|
|
#
|
|
# build.sh
|
|
|
|
if [ -f $1.c ]; then
|
|
echo
|
|
echo "--- Building $1 ---"
|
|
|
|
if [ -f $1.s ]; then
|
|
rm $1.s
|
|
fi
|
|
if [ -f $1.o ]; then
|
|
rm $1.o
|
|
fi
|
|
if [ -f $1.bin ]; then
|
|
rm $1.bin
|
|
fi
|
|
if [ -f $1.hex ]; then
|
|
rm $1.hex
|
|
fi
|
|
|
|
cc65 -t sym1 -O $1.c
|
|
ca65 $1.s
|
|
ld65 -C sym1.cfg -m $1.map -o $1.bin $1.o sym1.lib
|
|
if [ -f $1.bin ]; then
|
|
bin2hex $1.bin $1.hex > /dev/null 2>&1
|
|
fi
|
|
if [ -f $1.hex ]; then
|
|
echo "--- $1.hex made ---"
|
|
else
|
|
echo "--- $1.hex FAIL ---"
|
|
fi
|
|
|
|
|
|
fi
|
|
|