[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Re: Problem with WinAVR
From: |
Jimmy Shen |
Subject: |
[avr-gcc-list] Re: Problem with WinAVR |
Date: |
Fri, 16 Apr 2004 13:14:35 -0700 |
Here is the makefile requested to be posted to go along with the probelm I
posted earlier about the " unrecognized option `-cu=at90s8535' ".
---------------------------------------------------------------------------------------------------------------------------------
# Makefile to build gyrobot for GCC
#
# Larry Barello May, 2001, 2003
#
# Uses GCC tools (make, rm)
#
# Generic stuff.
#
# Avrdude command line: Intel Hex, Sample programmer, chip.
PROG = avrdude -c bascom -p $(GCCMCU) -E noreset
# STK500 command line programmer.
# PROG = c:/progra~1/atmel/avrstu~1/stk500/stk500.exe
RM = rm -f
# GCCMCU = atmega163
GCCMCU = at90s8535
# GCCMCU = atmega16
#GCC Equates
FORMAT = coff-avr
# GCCLIB = $(AVRX)/avrx/avrx.a
GCCLIB = avrx.a
GCCINC = -I. -I$(AVRX)/avrx -I$(AVR)/avr/include
LDFLAGS = -Wl,-lm,-Map=$(<:.o=.map),--cref,-v -mmcu=$(GCCMCU)
AFLAGS = -c -mmcu=$(GCCMCU) -Wa,-gstabs -mmcu=$(GCCMCU) -I$(GCCINC)
CFLAGS = -Os -Wall -g -mmcu=$(GCCMCU) $(TARGET)
BIN = avr-objcopy
CC = avr-gcc
AS = avr-gcc -x assembler-with-cpp
ELFCOF = objtool
CP = cp
OUT = coff
SHELL = sh.exe
#specific stuff to my build
# TARGET = -DODOMETRY
# TARGET = -D_MONITOR_
# TARGET = -D_MONITOR_ -DODOMETRY
SRC = GyroBot.c MotorTask.c LcdTask.c SensorTask.c Gyro_eeprom.c
ASRC = lcdio.s lcd.s Encoder.s adc_driver.s
GCCOBJ = $(SRC:.c=.o) $(ASRC:.s=.o)
# GCC Rules
%o: %c
$(CC) -c $< $(GCCINC) $(CFLAGS) -o $@
%s: %c
$(CC) -S $< $(GCCINC) $(CFLAGS) -o $@
%o: %s
$(AS) $(AFLAGS) $< -o $@
%elf: %o
$(CC) $< $(GCCLIB) $(LDFLAGS) -o $@
%obj: %elf
$(BIN) -O avrobj -R .eeprom $< $@
%cof: %elf
avr-objcopy \
--debugging \
-O $(FORMAT) \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000 \
$< $@
# $(filename).elf $(filename).cof
%ok:
@echo "Errors: none"
%hex: %elf
$(BIN) -O ihex $< $@
%eep: %elf
$(BIN) -j .eeprom --set-section-flags=.eeprom="alloc,load"
--change-section-lma .eeprom=0 -O ihex $< $@
cp GyroBot.eep GyroBot.eep.hex
# Rules specific to my project (default to GCC)
gcc: GyroBot.cof GyroBot.eep GyroBot.hex GyroBot.ok
clean:
$(RM) *.o *.lst *.map
$(RM) *.rom *.eep *.hex
$(RM) *.obj *.?_sym $(SRC:.c=.s)
# Command line STK500 programmer
burn.eep: GyroBot.eep
$(PROG) -m eeprom -i GyroBot.eep
# $(PROG) -d$(GCCMCU) -ieGyroBot.eep -ve -pe -z
# Note: -e erases chip... required for FLASH
burn.hex: GyroBot.hex
$(PROG) -e -m flash -i GyroBot.hex
# $(PROG) -d$(GCCMCU) -ifGyroBot.hex -vf -pf -e -z
burn: burn.hex burn.eep GyroBot.cof Gyrobot.ok
GyroBot.elf: $(GCCOBJ) $(GCCLIB)
$(CC) $(GCCOBJ) $(GCCLIB) $(LDFLAGS) -mmcu=$(GCCMCU) -o $@
assembly: $(SRC:.c=.s)
GyroBot.o: makefile hardware.h Gyro_eeprom.h gyroBot.c
MotorTask.o: makefile hardware.h Gyro_eeprom.h MotorTask.c SensorTask.h
LcdTask.o: makefile hardware.h Gyro_eeprom.h LcdTask.c lcdio.h lcdtask.h
MotorTask.h SensorTask.h
SensorTask.o: makefile hardware.h Gyro_eeprom.h SensorTask.c SensorTask.h
adc_driver.h encoder.h MotorTask.h
Gyro_eeprom.o: makefile Gyro_eeprom.c MotorTask.h BehaviorTask.h
SensorTask.h
adc_driver.o: makefile adc_driver.s
lcdio.o: makefile lcd.inc
lcd.o: makefile lcd.inc
# Old stuff
monitor.o: makefile monitor.c serialio.h adc_driver.h
serialio.o: makefile serialio.c serialio.h
Behavior.o: makefile BehaviorTask.c BehaviorTask.h
filter.o: makefile filter.c filter.h
-----------------------------------------------------------------------------------------------------------------------------------
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar get it now!
http://toolbar.msn.com/go/onm00200415ave/direct/01/
- [avr-gcc-list] Re: Problem with WinAVR,
Jimmy Shen <=