This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Makefile link order problem
- From: Alperen Coskun <a_a_coskunoc at hotmail dot com>
- To: ecos discuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 11 Jul 2008 10:05:19 +0300
- Subject: [ECOS] Makefile link order problem
Hi,
I'm using the makefile below to link my project files: from ecos source, from core source and my own source files. At last, i
aim to obtain an elf file 'file.elf'. But, I see a problem like that: When I change the order of compilation of file1 and file2, and
download my elf file to my target device, system breaks down. For example, at the last row of my elf file if I change the row to:
file.elf: file2.o file1.o
$(CC) file2.o file1.o -o $@ $(LDFLAGS) -Wl,--cref,-Map,$*.map
system breaks down. This may not be directly an ECOs problem, but i hope there will be someone who could help me or give an
example makefile creating an elf file? (I'm using powerpc)
Regards.
My MAKEFILE:
ECOS_INSTALL = /ecos/install/folder
CORE_INSTALL = /core/install/folder
ARCH = powerpc-eabi
CPU = -mcpu=405
MODEL = -msoft-float
CC = $(ARCH)-gcc $(CPU) $(MODEL)
LD = $(ARCH)-ld $(CPU) $(MODEL)
OBJCOPY = $(ARCH)-objcopy
OBJDUMP = $(ARCH)-objdump
INC = -I$(ECOS_INSTALL)/include -I$(CORE_INSTALL)/include
LIB = -L$(ECOS_INSTALL)/lib -Ttarget.ld
CFLAGS = -g -O2 -Wall -Wcast-align -fverbose-asm $(INC) -mbig-endian
LDFLAGS = -nostdlib -nostartfiles $(LIB)
all: file.elf
file1.o: file1.c
$(CC) $(CFLAGS) -c -o file1.o file1.c
file2.o: file2.c
$(CC) $(CFLAGS) -c -o file2.o file2.c
file.elf: file1.o file2.o
$(CC) file1.o file2.o -o $@ $(LDFLAGS) -Wl,--cref,-Map,$*.map
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss