|
楼主 |
发表于 2006-3-13 08:21:32
|
显示全部楼层
###############################################################################
# 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 coff size
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) $(TARGET) $(PROJECT).cof dep/* test1.hex test1.eep
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
我又改了,但还是出现了
Build started 13.3.2006 at 08:19:19
Makefile:46: *** missing separator. Stop.
Build failed with 1 errors and 0 warnings...
的错误,救救我吧 |
|