~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to bin/build-25.sh

  • Committer: Selene Scriven
  • Date: 2015-03-17 08:56:50 UTC
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: ubuntu@toykeeper.net-20150317085650-s89wr9h28n2co7z1
Added TheStar firmwares from _the_

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
# Instead of using a Makefile, since most of the firmwares here build in the
4
 
# same exact way, here's a script to do the same thing
5
 
 
6
 
export PROGRAM=$1
7
 
export ATTINY=25
8
 
export MCU=attiny$ATTINY
9
 
export CC=avr-gcc
10
 
export OBJCOPY=avr-objcopy
11
 
export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -DATTINY=$ATTINY -I.."
12
 
export OFLAGS="-Wall -g -Os -mmcu=$MCU"
13
 
export LDFLAGS=
14
 
export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex'
15
 
export OBJS=$PROGRAM.o
16
 
 
17
 
function run () {
18
 
  echo $*
19
 
  $*
20
 
  if [ x"$?" != x0 ]; then exit 1 ; fi
21
 
}
22
 
 
23
 
run $CC $CFLAGS -o $PROGRAM.o -c $PROGRAM.c
24
 
run $CC $OFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
25
 
run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex
26
 
run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full