Libraries provided with -l flags need to be given _after_ the object files. Compilation gave error in linking with the math library since the LDFLAGS were before the object file. Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@xxxxxxxxxxxxxxx> --- Makefile | 2 +- cwchash/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 03266b1..53e1184 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,7 @@ compile_EXTRA_DEPS = compile-i386.o $(foreach p,$(PROGRAMS),$(eval $(p): $($(p)_EXTRA_DEPS) $(LIBS))) $(PROGRAMS): % : %.o - $(QUIET_LINK)$(LD) $(LDFLAGS) -o $@ $^ $($@_EXTRA_OBJS) + $(QUIET_LINK)$(LD) -o $@ $^ $($@_EXTRA_OBJS) $(LDFLAGS) smatch: smatch.o $(SMATCH_FILES) $(SMATCH_CHECKS) $(LIBS) $(CC) -o $@ $< $(SMATCH_FILES) $(SMATCH_CHECKS) $(LIBS) $(LDFLAGS) diff --git a/cwchash/Makefile b/cwchash/Makefile index 3b7b5e9..5a1f65c 100644 --- a/cwchash/Makefile +++ b/cwchash/Makefile @@ -1,6 +1,6 @@ tester: hashtable.o tester.o hashtable_itr.o - gcc -g -Wall -O -lm -o tester hashtable.o hashtable_itr.o tester.o + gcc -g -Wall -O -o tester hashtable.o hashtable_itr.o tester.o -lm all: tester old_tester -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe smatch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html