|
我用AVR-GCC,按 archeng504 阿成 提供的makefile格式,改了我的makefile,build时输出了
Build started 11.3.2006 at 17:29:28
Makefile:46: *** missing separator. Stop.
Build failed with 1 errors and 0 warnings...
的错误提示
我改的makefile 文件如下:
###############################################################################
# Makefile for the project test1
###############################################################################
## General Flags
PROJECT = test1
MCU = atmega8
TARGET = test1.elf
CC = avr-gcc.exe
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gstabs -O0 -fsigned-char
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS +=
## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom
HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0
## Objects that must be built in order to link
OBJECTS = test1.o
## Objects explicitly added by the user
LINKONLYOBJECTS =
## Build
all: $(TARGET) test1.hex test1.eep test1.coff
COFFCONVERT= avr-objcopy --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000
coff: $(PROJECT).elf
$(COFFCONVERT) -O coff-avr $< $(PROJECT).cof
## Compile
test1.o: ../test1.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
%.eep: $(TARGET)
avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@
%.lss: $(TARGET)
avr-objdump -h -S $< > $@
size: ${TARGET}
@echo
@sh avr-mem.sh ${TARGET} ${MCU}
## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) test1.elf test1.cof dep/* test1.hex test1.eep
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|