* Use $(CC) instead of gcc. * Honor LDFLAGS. * Put -l flags at the end so it doesn't break --as-needed linker flag (bug #246904) --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CFLAGS= -O3 -s -Wall -DNUTDIR=\".nutdb\" -DFOODDIR=\"/usr/local/lib/nut\" -ansi -pedantic nut: $(objects) - gcc ${CFLAGS} -lm -o nut $(objects) + $(CC) ${CFLAGS} -o nut $(LDFLAGS) $(objects) -lm deps: makedepend *.c