~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to bin/build-85.sh

  • Committer: Selene Scriven
  • Date: 2017-09-12 23:34:36 UTC
  • mto: (188.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 331.
  • Revision ID: bzr@toykeeper.net-20170912233436-d3w6nln0ts1subue
Added Flintrock's Bistro-HD 1.0.

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=85
 
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