I'm a little new to this and am trying to build a rather large project. In particular, the source code is executing the lines
gcc -Wall -W -c -o setitimer-helper.o setitimer-helper.c
gcc -lm setitimer-helper.o -o setitimer-helper
This creates a linker error because according to this C: Undefined reference to floor -lm now must come after the object files.
I need to know where in the source code I can find and rearrange this. I think it's in here, but I'm unfamiliar with Unix.
CC = gcc
CFLAGS = -Wall -W
LDFLAGS = -lm
all: setitimer-helper squish-pty squish-unix
%.o: %.c
$(CC) -c $< -o $@
%: %.c
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
clean:
rm -f *.o setitimer-helper squish-pty squish-unix
Am I correct? If so, how can I fix this. If not, where should I look?
Thanks.