Subversion Repositories pentevo

Rev

Rev 901 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
901 lvd 1
#!/bin/bash
2
 
3
#make sure it runs from correct place -- 'cd' to the dir where this script is situated
4
cd ${0%/*}
5
 
6
# some variables
7
FPGA_PATH=fpga/quartus
8
FPGA_FILE=top.rbf
9
 
10
AVR_PATH=avr/build
11
AVR_FILE=top.mlz
12
 
13
RESULT=zxevo_fw.bin
14
 
15
MHMT_BIN=../../../tools/mhmt/mhmt
16
 
17
 
18
# build FPGA
19
cd $FPGA_PATH && make
20
cd -
21
 
22
# check whether top.rbf exists
23
if [ ! -f "$FPGA_PATH/$FPGA_FILE" ]; then
24
        echo Error: $FPGA_FILE was not built!
25
        exit 1
26
fi
27
 
28
# pack and copy fpga file to avr dir
29
$MHMT_BIN -maxwin2048 $FPGA_PATH/$FPGA_FILE $AVR_PATH/$AVR_FILE || { echo 'mhmt failed!' ; exit 1; }
30
 
31
# go build avr firmware
32
cd $AVR_PATH && make
33
cd -
34
 
35
# check whether there is end file
36
if [ ! -f "$AVR_PATH/$RESULT" ]; then
37
        echo Error: $RESULT was not build!
38
        exit 1
39
fi
40
 
41
cp $AVR_PATH/$RESULT ./
42
 
43
echo Done!
44