Problem with makefile
2005-02-21 by joelteply
I am having newbie problems getting the core gcc functions defined in my program. I need to get the gcc functions linked in. Right now I can't do division or string functions. Here is an example of the errors: "undefined reference to memcpy" "undefined reference to __udivi" (or something like that) Those are defined in libgcc.a, but I can't link them in correctly. What changes do I need to make to this makefile? NAME = test io CC = arm-elf-gcc LD = arm-elf-ld -v AR = arm-elf-ar AS = arm-elf-as CP = arm-elf-objcopy .SUFFIXES : .o .c .s CFLAGS = -I./ -c -O3 AFLAGS = -ahls -mapcs-32 CAFLAGS = $(CFLAGS) -Wa,-ahls,-mapcs-32 LFLAGS = -Map main.map -nostartfiles -T simple.cmd CPFLAGS = -O ihex test: main.out @ echo "...copying" $(CP) $(CPFLAGS) main.out main.hex main.out: start.o ivt.o main.o simple.cmd @ echo "..linking" $(LD) $(LFLAGS) -o main.out start.o ivt.o main.o .c.o: @ echo ".compiling" @ $(CC) $(CAFLAGS) $< > a.lst mainin: start.s ivt.s main.c @ echo ".compiling" $(CC) $(CFLAGS) start.s ivt.s main.c Any help would be greatly appreciated. Thanks in advance.