[an error occurred while processing this directive]
Можешь мой попробовать только свои данные в юзер дефайн секции поставь
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено si 24 февраля 2005 г. 10:27
В ответ на: хотелось бы надеятся, что будет поменьше проблем с ИАРом, просто не понимаю, что ещё ему нужно, чтобы маке файл был нормальным? Вроде всё уже перепробовал. отправлено Свирепый Бамбр 24 февраля 2005 г. 10:19


################### USER'S DEFINE SECTION ###############################
# Type of Atmel MCU #
MCU = atmega128
# Target #
TRG = keyboard
# Source files to be translated #

SRC = src/main.c src/buffer.c src/cmdline.c src/pulse.c src/rprintf.c \
src/timer128.c src/uart2.c src/key.c src/keycommand.c \
src/leds.c src/convert.c src/parser.c src/progeeprom.c




###### define some variables based on the AVR base path in $(AVR) #######
CC = avr-gcc
AS = avr-gcc -x assembler-with-cpp
RM = rm -f
RN = mv
OBJCOPY = avr-objcopy
BIN = avr-objcopy
SIZE = avr-size
INCDIR = .
LIBDIR = $(AVR)/avr/lib
SHELL = $(AVR)/utils/bin/sh.exe
###### output format can be srec, ihex (avrobj is always created) #######
FORMAT = ihex
########################## default mcu type #############################
# MCU = at90s8515
####################### default compiler flags ##########################

# Compiler flag to set the C Standard level.
# c89 - "ANSI" C
# gnu89 - c89 plus GCC extensions
# c99 - ISO C99 standard (not yet fully implemented)
# gnu99 - c99 plus GCC extensions
CSTANDARD = -std=c89

# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s


# Compiler flags.
# -g: generate debugging information
# -O*: optimization level
# -f...: tuning, see GCC manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
CFLAGS = -g
CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -Wall -Wstrict-prototypes
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
#CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)


# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:


# Assembler flags.
# -Wa,...: tell GCC to pass this to the assembler.
# -ahlms: create listing
# -gstabs: have the assembler create line number information; note that
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs

########################## default linker flags #########################

# Linker flags.
# -Wl,...: tell GCC to pass this to linker.
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TRG).map,--cref


CPFLAGS = -g -Os -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)

# Compiler flags #
# CPFLAGS = -Wall -mcall-prologues -gstabs -O2 -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)
################### USER'S DEFINE SECTION ###############################
# GCC-AVR standard Makefile part 2
# Volker Oth 1/2000
# Modified by AVRfreaks.net for smoother integrasjon with AVR Studio. (06/2001)

#define all project specific object files
OBJ = $(ASRC:.s=.o) $(SRC:.c=.o)
CPFLAGS += -mmcu=$(MCU)
ASFLAGS += -mmcu=$(MCU)
LDFLAGS += -mmcu=$(MCU)

#this defines the aims of the make process
all: $(TRG).elf $(TRG).cof $(TRG).hex $(TRG).eep $(TRG).ok
#$(TRG).size

#compile: instructions to create assembler and/or object files from C source
%o : %c
$(CC) -c $(CPFLAGS) -I$(INCDIR) $< -o $@

%s : %c
$(CC) -S $(CPFLAGS) -I$(INCDIR) $< -o $@

#assemble: instructions to create object file from assembler files
%o : %s
$(AS) -c $(ASFLAGS) -I$(INCDIR) $< -o $@

#link: instructions to create elf output file from object files
%elf: $(OBJ)
$(CC) $(OBJ) $(LIB) $(LDFLAGS) -o $@


# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT = $(BIN) --debugging
COFFCONVERT += --change-section-address .data-0x800000
COFFCONVERT += --change-section-address .bss-0x800000
COFFCONVERT += --change-section-address .noinit-0x800000
COFFCONVERT += --change-section-address .eeprom-0x810000


%cof: %elf
@echo
@echo $(MSG_EXTENDED_COFF) $(TRG).cof
$(COFFCONVERT) --debugging -O coff-ext-avr $< $@

#create avrobj file from elf output file
#%obj: %elf
# $(BIN) -O avrobj -R .eeprom $< $@
#create bin (ihex, srec) file from elf output file
%hex: %elf
$(BIN) -O $(FORMAT) -R .eeprom $< $@
%eep: %elf
$(BIN) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O $(FORMAT) $< $@

#If all other steps compile ok then echo "Errors: none".
#Necessary for AVR Studio to understand that everything went ok.
%ok:
@echo "Errors: none"

#%size:
# $(SIZE) $(TRG).elf

#make instruction to delete created files
clean:
$(RM) $(OBJ)
$(RM) $(SRC:.c=.s)
$(RM) $(SRC:.c=.lst)
$(RM) $(TRG).map
$(RM) $(TRG).elf
$(RM) $(TRG).cof
$(RM) $(TRG).obj
$(RM) $(TRG).a90
$(RM) $(TRG).hex

$(RM) *.bak
$(RM) *.log

size:
$(SIZE) $(TRG).elf


Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru