From: Mathieu Desnoyers Date: Tue, 14 May 2013 12:36:00 +0000 (+0200) Subject: Revert "Fix linker library order" X-Git-Tag: v2.2.0-rc3~22 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=661805af83e2d4e7fa19432d6ae553460d6cd524;p=lttng-ust.git Revert "Fix linker library order" This reverts commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f. Hrm, actually, these patches are wrong. commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f for instance: "Libraries must be specified after the binary target." demo: demo.o - $(CC) -o $@ $(LIBS) $^ + $(CC) -o $@ $^ $(LIBS) the binary target here is "$@". $^ is the source file name (demo.c). this patch moves the source file name prior to the libraries, which is incorrect (ref: gcc(1)). The input files should appear last. So it breaks builds where $(LIBS) is non-empty. Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile index bbc8ccb7..7ae6547e 100644 --- a/doc/examples/demo/Makefile +++ b/doc/examples/demo/Makefile @@ -55,7 +55,7 @@ demo.o: demo.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< demo: demo.o - $(CC) -o $@ $^ $(LIBS) + $(CC) -o $@ $(LIBS) $^ .PHONY: clean clean: