2 #OBJ = brmpuk.o sabertooth.o lcd.o serial.o
5 OBJ
= motor_test.o sabertooth.o lcd.o serial.o
7 MCU_TARGET
= atmega128
#at90s2313
13 # You should not have to change anything below here.
17 # Override is only needed by avr-lib build system.
19 override CFLAGS
= -g
-Wall
$(OPTIMIZE
) -mmcu
=$(MCU_TARGET
) $(DEFS
)
20 override LDFLAGS
= -Wl
,-Map
,$(PRG
).map
25 all: $(PRG
).elf lst text eeprom
28 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$^
$(LIBS
)
31 rm -rf
*.o
$(PRG
).elf
*.eps
*.png
*.pdf
*.bak
32 rm -rf
*.lst
*.map
$(EXTRA_CLEAN_FILES
)
37 $(OBJDUMP
) -h
-S
$< > $@
39 # Rules for building the .text rom images
48 $(OBJCOPY
) -j .text
-j .data
-O ihex
$< $@
51 $(OBJCOPY
) -j .text
-j .data
-O srec
$< $@
54 $(OBJCOPY
) -j .text
-j .data
-O binary
$< $@
56 # Rules for building the .eeprom rom images
58 eeprom
: ehex ebin esrec
60 ehex
: $(PRG
)_eeprom.hex
61 ebin
: $(PRG
)_eeprom.bin
62 esrec
: $(PRG
)_eeprom.srec
65 $(OBJCOPY
) -j .eeprom
--change-section-lma .eeprom
=0 -O ihex
$< $@
68 $(OBJCOPY
) -j .eeprom
--change-section-lma .eeprom
=0 -O srec
$< $@
71 $(OBJCOPY
) -j .eeprom
--change-section-lma .eeprom
=0 -O binary
$< $@
73 # Every thing below here is used by avr-libc's build system and can be ignored
77 EXTRA_CLEAN_FILES
= *.hex
*.bin
*.srec
86 $(FIG2DEV
) -L eps
$< $@
89 $(FIG2DEV
) -L pdf
$< $@
92 $(FIG2DEV
) -L png
$< $@
95 uisp
-dprog
=stk200
--erase
--upload
--verify if
=$< -dlpt
=0x378 -v
=3 --hash
=12
98 avrdude
-c pony-stk200
-E noreset
-P
/dev
/parport0
-p m128
-U flash
:w
:$<
100 avrdude
-v
-c avr109
-P
/dev
/ttyUSB0
-b
38400 -p m128
-U flash
:w
:$<
104 avrdude
-c pony-stk200
-E noreset
-P
/dev
/parport0
-p m128
-U lfuse
:r
:lfuse
:b
-U hfuse
:r
:hfuse
:b
-U efuse
:r
:efuse
:b
109 avrdude
-U lfuse
:w
:0xe4:m