# Target file name (without extension).
TARGET = isdnsimu
OBJECTS=$(TARGET).o
MCU = atmega48
F_CPU = 12000000
#---------------- Compiler Options ----------------
CFLAGS = -DF_CPU=$(F_CPU) -Os -ffunction-sections -Wall
#---------------- Linker Options ----------------
LDFLAGS = -Wl,--relax -Wl,--gc-sections
CC = avr-gcc -mmcu=$(MCU)
OHEX = avr-objcopy -O ihex
DUMP = avr-objdump -d
SIZE = avr-size --mcu=$(MCU)
all: $(TARGET).hex $(TARGET).lst
# Compile+link: create executeable image from source files
%.o: %.S Makefile
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.cpp Makefile
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.c Makefile
$(CC) $(CFLAGS) -c $< -o $@
%.elf: $(OBJECTS)
$(CC) $(LDFLAGS) $^ -o $@
$(SIZE) $@
# Create files (.hex, .eep) for programming
%.hex: %.elf
$(OHEX) -j .text -j .data $< $@
# Create listing
%.lst: %.elf
$(DUMP) $< > $@
# Program the device
flash: $(TARGET).hex program
program:
d:/henni/msvc/inpout32/release/crundll d:/henni/msvc/inpout32/release/inpout32,CatchIo avrdude -c pony-stk200 -P lpt1 -p $(MCU) -U flash:w:$(TARGET).hex:i -E noreset
# Cleanup directory but keep .hex and .eep
clean:
$(RM) $(OBJECTS) $(TARGET).elf $(TARGET).lst
# Listing of phony targets.
.PHONY : all elf hex eep lst clean program
Vorgefundene Kodierung: ASCII (7 bit) | 2
|