Hallo,

ich versuche mein Projekt in AVRStudio zu debuggen, was bisher allerdings misslingt, da der Build in AVRStudio immer fehlschlägt.

Ich verwende Funktionen aus der Procyon AVRlib, schätzungsweise hakt es deshalb...

Wenn ich das makefile von AVRStudio erzeugen lassen, erhalte ich folgende Fehlermeldung:

make: *** No rule to make target `..//C/dev/AVRlib/buffer.c', needed by `buffer.o'. Stop.
Kann mich jemand aufklären? Ich habe alle avrlib-sourcen eingebunden, include-pfade gesetzt usw.

Das von AVRStudio generierte makefile:
Code:
################################################################################
# Makefile for the project test
###############################################################################

## General Flags
PROJECT = test
MCU = atmega8
TARGET = test
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 -gdwarf-2  -DF_CPU=8000000UL -O0 -fsigned-char
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 += 


## 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 --no-change-warnings


## Include Directories
INCLUDES = -I"F:\electronics + programmcode\PCKEY\." -I"C:\dev\AVRlib" 

## Library Directories
LIBDIRS = -L"C:\dev\avrlib" 

## Objects that must be built in order to link
OBJECTS = pckb.o test.o buffer.o i2c.o i2ceeprom.o rprintf.o 

## Objects explicitly added by the user
LINKONLYOBJECTS = 

## Build
all: $(TARGET) test.hex test.eep size

## Compile
pckb.o: ../pckb.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

test.o: ../test.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

buffer.o: ..//C/dev/AVRlib/buffer.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

i2c.o: ..//C/dev/AVRlib/i2c.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

i2ceeprom.o: ..//C/dev/AVRlib/i2ceeprom.c
	$(CC) $(INCLUDES) $(CFLAGS) -c  $<

rprintf.o: ..//C/dev/AVRlib/rprintf.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 $< > $@

size: ${TARGET}
	@echo
	@avr-size -C --mcu=${MCU} ${TARGET}

## Clean target
.PHONY: clean
clean:
	-rm -rf $(OBJECTS) test dep/* test.hex test.eep

## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)

Wenn ich das Projekt über das ursprüngliche makefile erstelle, klappt alles wunderbar.
AVRStudio allerdings stürzt ab, wenn ich es einbinde (ext. makefile verwenden)

ursprüngliches makefile:
Code:

# Makefile for AVR function library development and examples
# Author: Pascal Stang
#
# For those who have never heard of makefiles: a makefile is essentially a
# script for compiling your code.  Most C/C++ compilers in the world are
# command line programs and this is even true of programming environments
# which appear to be windows-based (like Microsoft Visual C++).  Although
# you could use AVR-GCC directly from the command line and try to remember
# the compiler options each time, using a makefile keeps you free of this
# tedious task and automates the process.
#
# For those just starting with AVR-GCC and not used to using makefiles,
# I've added some extra comments above several of the makefile fields which
# you will have to deal with.

########### change this lines according to your project ##################
#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.)
#	MCU = atmega163
#	MCU = atmega161
#	MCU = atmega323
#	MCU = atmega128
	MCU = atmega8

#put the name of the target file here (without extension)
#  Your "target" file is your C source file that is at the top level of your code.
#  In other words, this is the file which contains your main() function.

	TRG = test

#put your C sourcefiles here
#  Here you must list any C source files which are used by your target file.
#  They will be compiled in the order you list them, so it's probably best
#  to list $(TRG).c, your top-level target file, last.

	SRC =  $(TRG).c $(AVRLIB)/rprintf.c $(AVRLIB)/uart.c $(AVRLIB)/buffer.c  pckb.c $(AVRLIB)/i2c.c $(AVRLIB)/i2ceeprom.c

#put additional assembler source file here
#  The ASRC line allows you to list files which contain assembly code/routines that
#  you would like to use from within your C programs.  The assembly code must be
#  written in a special way to be usable as a function from your C code.

	ASRC =

#additional libraries and object files to link
#  Libraries and object files are collections of functions which have already been
#  compiled.  If you have such files, list them here, and you will be able to use
#  use the functions they contain in your target program.

	LIB	=

#additional includes to compile
	INC	=

#assembler flags
	ASFLAGS = -Wa, -gstabs

#compiler flags
        CPFLAGS = -g -Os -Wall -Wstrict-prototypes -I$(AVRLIB) -Wa,-ahlms=$(<:.c=.lst)


#linker flags
	LDFLAGS = -Wl,-Map=$(TRG).map,--cref
	LDFLAGS += --no-channge-warnings
#	LDFLAGS = -Wl,-Map=$(TRG).map,--cref -lm
	
	
	
########### you should not need to change the following line #############
include $(AVRLIB)/make/avrproj_make
		
###### dependecies, add any dependencies you need here ###################
#  Dependencies tell the compiler which files in your code depend on which
#  other files.  When you change a piece of code, the dependencies allow
#  the compiler to intelligently figure out which files are affected and
#  need to be recompiled.  You should only list the dependencies of *.o
#  files.  For example: uart.o is the compiled output of uart.c and uart.h
#  and therefore, uart.o "depends" on uart.c and uart.h.  But the code in
#  uart.c also uses information from global.h, so that file should be listed
#  in the dependecies too.  That way, if you alter global.h, uart.o will be
#  recompiled to take into account the changes.

buffer.o		: buffer.c		buffer.h
uart.o		: uart.c			uart.h		global.h
UART2.o		: UART2.c		UART2.h		global.h
rprintf.o	: rprintf.c		rprintf.h
a2d.o			: a2d.c			a2d.h
timer.o		: timer.c		timer.h		global.h
pulse.o		: pulse.c		pulse.h		timer.h	global.h
lcd.o			: lcd.c			lcd.h			global.h
i2c.o			: i2c.c			i2c.h			global.h
spi.o			: spi.c			spi.h			global.h
swpwm.o		: swpwm.c		swpwm.h		global.h
servo.o		: servo.c		servo.h		global.h
swuart.o		: swuart.c		swuart.h		global.h
tsip.o		: tsip.c			tsip.h		global.h
nmea.o		: nmea.c			nmea.h		global.h
vt100.o		: vt100.c		vt100.h		global.h
gps.o			: gps.c			gps.h			global.h
$(TRG).o		: $(TRG).c						global.h
Danke, orbi