Hello,
I’m using the lastest version of Yagarto with LPC2138. I need to do some math based on sine and cosine, but the GCC always tells me “arm-elf-ld: cannot find -lm”. I have tried mainly everything but I cannot link with that library (libm.a). This is my make file, can anybody give me a hint? Thanks!
NAME = TEST
CC = arm-elf-gcc
LD = arm-elf-ld -v
AR = arm-elf-ar
AS = arm-elf-as
CP = arm-elf-objcopy
OD = arm-elf-objdump
SIZE = arm-elf-size
CFLAGS = -I./ -I./include -c -fno-common -O0 -g -mcpu=arm7tdmi
AFLAGS = -ahls -mapcs-32 -mcpu=arm7tdmi -o crt.o
LFLAGS = -Map ./release/${NAME}.map -T./config/lpc2138-FLASH.ld
CPFLAGS = -O ihex
ODFLAGS = -x --syms
all: build size
clean:
-rm ./release/crt.lst
-rm ./release/main.lst
-rm./release/crt.o
-rm ./release/main.o
-rm ./release/main.out
-rm ./release/${NAME}.hex
-rm ./release/${NAME}.map
-rm ./release/${NAME}.dmp
size:
@ echo "Size of Generated Hex File is "
$(SIZE) --target=ihex -t ./release/${NAME}.hex
build: main.out
@ echo "...copying"
$(CP) $(CPFLAGS) ./release/main.out ./release/${NAME}.hex
$(OD) $(ODFLAGS) ./release/main.out > ./release/${NAME}.dmp
main.out: crt.o delay.o io.o main.o system.o ./config/lpc2138-FLASH.ld
@ echo "..linking"
$(LD) $(LFLAGS) -o ./release/main.out ./release/cpu/crt.o ./release/delay.o ./release/system.o ./release/main.o ./release/cpu/io.o -L$(GCC_LIBS) -lm -lgcc
crt.o: ./src/cpu/crt.s
@ echo ".assembling crt.s"
$(AS) $(AFLAGS) ./src/cpu/crt.s > ./release/cpu/crt.lst -o ./release/cpu/crt.o
main.o: ./src/main.c
@ echo ".compiling"
$(CC) $(CFLAGS) ./src/main.c -o ./release/main.o
delay.o: ./src/delay.c
@ echo ".compiling delay"
$(CC) $(CFLAGS) ./src/delay.c -o ./release/delay.o
system.o: ./src/system.c
@ echo ".compiling system"
$(CC) $(CFLAGS) ./src/system.c -o ./release/system.o
io.o: ./src/cpu/io.c
@ echo ".compiling io"
$(CC) $(CFLAGS) ./src/cpu/io.c -o ./release/cpu/io.o
Thanks!
Ezequiel