42 lines
1.4 KiB
Perl
42 lines
1.4 KiB
Perl
#!/usr/bin/perl
|
|
#################################################################################
|
|
# #
|
|
# Build script for native AVR programs #
|
|
# copyright (c) 2009 Joerg Wolfram (joerg@jcwolfram.de) #
|
|
# #
|
|
# #
|
|
# This program is free software; you can redistribute it and/or #
|
|
# modify it under the terms of the GNU General Public License #
|
|
# as published by the Free Software Foundation; either version 3 #
|
|
# of the License, or (at your option) any later version. #
|
|
# #
|
|
# This program is distributed in the hope that it will be useful, #
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU #
|
|
# General Public License for more details. #
|
|
# #
|
|
# You should have received a copy of the GNU General Public #
|
|
# License along with this library; if not, write to the #
|
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, #
|
|
# Boston, MA 02111-1307, USA. #
|
|
# #
|
|
#################################################################################
|
|
$fname=$ARGV[0];
|
|
$asm_file=$fname.".asm";
|
|
$hex_file=$fname.".hex";
|
|
$bin_file=$fname.".bin";
|
|
|
|
|
|
$dummy=`avra $asm_file 2>&1`;
|
|
print $dummy;
|
|
$dummy=`hex2bin $hex_file`;
|
|
print $dummy;
|
|
$dlen=(-s $bin_file);
|
|
print $dlen;
|
|
$zlen=3072-$dlen;
|
|
$cmd="dd if=/dev/zero bs=1 count=".$zlen.">dummy.bin";
|
|
$dummy=`$cmd`;
|
|
$dummy=`cat dummy.bin >> $bin_file`;
|
|
$dummy=`rm -f dummy.bin`;
|
|
|