2016-07-13 17:19:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-10-24 13:24:18 +00:00
|
|
|
# Base defaults to 250, but can be passed in
|
|
|
|
BASE=${1:-250}
|
2016-07-13 17:19:41 +00:00
|
|
|
DESIGNS="6502cpu 6502fast 6502mon z80cpu 6809cpu"
|
|
|
|
DATE=$(date +"%Y%m%d_%H%M")
|
|
|
|
|
|
|
|
VERSION=$(grep "define VERSION" firmware/AtomBusMon.c | cut -d\" -f2)
|
|
|
|
|
2016-10-24 13:24:18 +00:00
|
|
|
DIR=releases/$BASE/$VERSION/$DATE/
|
|
|
|
|
|
|
|
echo "Building release in: "$DIR
|
2016-07-13 17:19:41 +00:00
|
|
|
|
|
|
|
mkdir -p $DIR
|
|
|
|
|
|
|
|
pushd firmware
|
|
|
|
|
|
|
|
# Compile the firmware and inject into the .bit file
|
|
|
|
for i in $DESIGNS
|
|
|
|
do
|
|
|
|
make -f Makefile.$i clean
|
2016-10-24 13:24:18 +00:00
|
|
|
make -f Makefile.$i SRC_DIR=src/${BASE} WORKING_DIR=working/${BASE}
|
|
|
|
ls -l *.bit
|
2016-07-13 17:19:41 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Create a .MCS file and move to releases directory
|
2016-10-24 13:24:18 +00:00
|
|
|
# . /opt/Xilinx/14.7/ISE_DS/settings*.sh
|
2016-07-13 17:19:41 +00:00
|
|
|
for i in $DESIGNS
|
|
|
|
do
|
|
|
|
NAME=avr${i}
|
2016-10-24 13:24:18 +00:00
|
|
|
/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin/promgen -u 0 $NAME.bit -o $NAME.mcs -p mcs -w -spi -s 8192
|
2016-07-13 17:19:41 +00:00
|
|
|
mv $NAME.mcs ../$DIR
|
|
|
|
rm -f $NAME.bit $NAME.cfi $NAME.prm
|
|
|
|
done
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
2016-10-24 13:24:18 +00:00
|
|
|
echo "Built release in: "$DIR
|
2016-07-13 17:19:41 +00:00
|
|
|
ls -lt $DIR
|
|
|
|
|