# This script should be located in the EMACboot_3core directory,
# with input, interm, and output directories below it.

# preparation for build
rm -f interm/*.*
cd input

# generate the boot table in big endian format
../../Utilities/hex6x core0.rmd
../../Utilities/hex6x core1.rmd
../../Utilities/hex6x core2.rmd

# merge all boot tables into one big boot table
../../Utilities/mergebtbl core0.btbl core1.btbl core2.btbl simple.btbl

../../Utilities/bconvert64x -le simple.btbl simple.btbl.be

# generate the Ethernet boot table frame 
../../Utilities/bootpacket simple.btbl.be simple.eth

# output file
mv simple.eth ../output

# intermediate files
mv *.btbl ../interm
mv *.btbl.be ../interm

# display the output files
cd ..
ls -al output
