So, nun bin ich ein Stück weiter.
Ich hatte zu Testzwecken nur eine leere main Funktion, und sonst garnix.
Kein Inhalt, keie elf-Datei.
Nun habe ich das 1. Testprogramm aus dem Tutorial verwendet.
Nun gibt es eine andere Fehlermeldung:
Build started 12.6.2016 at 06:11:56
make: *** No rule to make target `../test.c', needed by `test.o'. Stop.
Build failed with 1 errors and 0 warnings...
Das Make-File hat folgenden Inhalt.
########################################################################
#######
# Makefile for the project test
########################################################################
#######
## General Flags
PROJECT = test
MCU = atmega168
TARGET = test.elf
CC =
CPP = avr-g++
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS += -Wl,-Map=test.map
## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
## Objects that must be built in order to link
OBJECTS = test.o
## Objects explicitly added by the user
LINKONLYOBJECTS =
## Build
all: $(TARGET) test.hex test.eep test.lss## Compile
test.o: ../test.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 $< $@ || exit 0
%.lss: $(TARGET)
avr-objdump -h -S $< > $@
## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) test.elf dep/* test.hex test.eep test.lss test.map
## Other dependencies
-include $(shell mkdir dep 2>NUL) $(wildcard dep/*)
Da steht sehr viel., was ich als Anfänger nicht verstehe.
Diese Makefile wurde wohl bei den Programminstalationen von Studio4 bzw.
WinAVR automatisch erzeugt. Stammt also nicht von mir. Und ich werde
mich hüten, hier eigenmächtig etwas zu ändern