~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to bin/build.sh

  • Committer: Selene Scriven
  • Date: 2015-04-02 01:06:59 UTC
  • Revision ID: ubuntu@toykeeper.net-20150402010659-9wvzec8tc9travay
Improved info for Windows users in the README.
Showed how to add suid on avrdude for convenience.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# same exact way, here's a script to do the same thing
5
5
 
6
6
export PROGRAM=$1
7
 
export ATTINY=13
8
 
export MCU=attiny$ATTINY
 
7
export MCU=attiny13
9
8
export CC=avr-gcc
10
9
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"
 
10
export CFLAGS="-Wall -g -Os -mmcu=$MCU"
13
11
export LDFLAGS=
14
12
export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex'
15
13
export OBJS=$PROGRAM.o
21
19
}
22
20
 
23
21
run $CC $CFLAGS -o $PROGRAM.o -c $PROGRAM.c
24
 
run $CC $OFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
 
22
run $CC $CFLAGS $LDFLAGS -o $PROGRAM.elf $PROGRAM.o
25
23
run $OBJCOPY $OBJCOPYFLAGS $PROGRAM.elf $PROGRAM.hex
26
 
run avr-size -C --mcu=$MCU $PROGRAM.elf | grep Full
 
24
run avr-size $PROGRAM.hex