?? makefile.old.iar
字號:
# AvrX 2.5 GCC Examples makefile
# Larry Barello May, 2000
#
# Uses GCC tools (make, rm)
#
# Generic stuff.
#
DEBUG = --debug
RM = rm -f
#
# MCU - What a mess. IAR uses different mechanisms for C and ASM
# and buggers the identifier for the mega parts so the GCCMCU will break
# with mega parts. The AVRXMCU goes away when IAR updates their tools for
# unified IO headers (ioavr.h) NB: IAR Also needs the linker files changed too.
#
# MCU = 8515, 8535, mega103, mega163, etc (C compiler input)
# AAVRMCU = 0, 1, 2, ...
# GCCMCU = at90s8535, atmega103, etc
# AVRXMCU = (see define) - matches what ICCAVR will pass in the future...
#
MCU = 8535
AAVRMCU = 1
GCCMCU = at90s$(MCU)
AVRXMCU = __AT90S$(MCU)__
#GCC Equates
FORMAT = ihex
DEBUG = stabs
# DEBUG = dwarf-2 # .elf native format.
# COFF_TYPE = coff-avr # stabs output.
COFF_TYPE = coff-ext-avr
GCCLIB = ../avrx/avrx.a
GCCINC = -I. -I../avrx -I$(AVR)/avr/inc
LDFLAGS = -Wl,-Map=$(<:.o=.map),--cref,-v
AFLAGS = -c -mmcu=$(GCCMCU) -Wa,-g$(DEBUG) -mmcu=$(GCCMCU) -I$(GCCINC)
CFLAGS = -Os -Wall -Wstrict-prototypes -mmcu=$(GCCMCU) -g$(DEBUG) -Wa,-adhlns=$(<:.c=.lst)
BIN = avr-objcopy
CC = avr-gcc
AS = avr-gcc -x assembler-with-cpp
#IAR Equates
IARLIB = ../avrx/avrx.r90 $(IAR)/avr/lib/dl1s.r90
IARINC = -I. -I../avrx -I$(IAR)/avr/inc
AAVRFLAGS = -v1 -b -re -D$(AVRXMCU)
XLINKFLAGS = -f lnk8535s -x -z -FINTEL-STANDARD -l $(@:.d90=.map) -o $(@:.d90=.hex) -Oubrof6=.d90
ICCFLAGS = --cpu=$(MCU) --debug -e -z9 -ms -D$(AVRXMCU) -la $(@:.r90=.lst)
ICC = iccavr
AAVR = aavr
XLINK = xlink
SRC = BasicTest1.c BasicTest2.c BasicTest3.c BasicTest4.c
# IAR Rules (Need more rules to make EEPROM files)
%r90: %s
$(AAVR) $< $(IARINC) $(AAVRFLAGS)
%r90: %c
$(ICC) $< $(IARINC) $(ICCFLAGS) -la $(@:.r90=.lst) -o $@
%d90: %r90 $(IARLIB)
$(XLINK) $< $(IARLIB) $(XLINKFLAGS)
# GCC Rules
%o: %c makefile
$(CC) -c $< $(GCCINC) $(CFLAGS) -o $@
%s: %c makefile
$(CC) -S $< $(GCCINC) $(CFLAGS) -o $@
%o: %s makefile
$(AS) $(AFLAGS) $< -o $@
%elf: %o $(GCCLIB) makefile
$(CC) $< $(GCCLIB) $(LDFLAGS) -mmcu=$(GCCMCU) -o $@
%obj: %elf
$(BIN) -O avrobj $< $@
%hex: %elf
$(BIN) -O $(FORMAT) $< $@
%eep: %elf
$(BIN) -j .eeprom --set-section-flags=.eeprom="alloc,load" -O $(FORMAT) $< $@
COFFCONVERT=$(BIN) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000
%cof: %elf
$(COFFCONVERT) -O coff-ext-avr $< $@
all: iar gcc
iar: $(SRC:.c=.d90)
#gcc: $(SRC:.c=.hex) $(SRC:.c=.eep) # this one for dwarf-2 debugging
gcc: $(SRC:.c=.cof) $(SRC:.c=.hex) $(SRC:.c=.eep) # this one for stabs debugging
clean:
$(RM) $(SRC:.c=.d90) $(SRC:.c=.s) $(SRC:.c=.elf) $(SRC:.c=.r90) $(SRC:.c=.o) $(SRC:.c=.lst)
$(RM) $(SRC:.c=.hex) $(SRC:.c=.eep) $(SRC:.c=.rom) $(SRC:.c=.map) $(SRC:.c=.c_sym) $(SRC:.c=.obj)
# depends section
Messages.o: Messages.c hardware.h makefile
MessagesAndData.o: MessagesAndData.c hardware.h makefile
MessageTimers.o: MessageTimers.c hardware.h makefile
MessageTimersAlt.o: MessageTimersAlt.c hardware.h makefile
Timers.o: hardware.h makefile Timers.c
Messages.r90: Messages.c hardware.h makefile
MessagesAndData.r90: MessagesAndData.c hardware.h makefile
MessageTimers.r90: MessageTimers.c hardware.h makefile
MessageTimersAlt.r90: MessageTimersAlt.c hardware.h makefile
Timers.r90: hardware.h makefile Timers.c
Messages.d90: Messages.r90 $(IARLIB)
MessagesAndData.d90: MessagesAndData.r90 $(IARLIB)
MessageTimers.d90: MessageTimers.r90 $(IARLIB)
MessageTimersAlt.d90: MessageTimersAlt.r90 $(IARLIB)
Timers.d90: Timers.r90 $(IARLIB)
Messages.elf: Messages.o $(GCCLIB)
MessagesAndData.elf: MessagesAndData.o $(GCCLIB)
MessageTimers.elf: MessageTimers.o $(GCCLIB)
MessageTimersAlt.elf: MessageTimersAlt.o $(GCCLIB)
Timers.elf: Timers.o $(GCCLIB)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -