Revert "Fix linker library order"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 May 2013 12:36:00 +0000 (14:36 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 May 2013 12:36:00 +0000 (14:36 +0200)
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 <mathieu.desnoyers@efficios.com>
doc/examples/demo/Makefile

index bbc8ccb7e6aae5821acf44236403a9865c195f07..7ae6547eff4a476bf2f75bae96cf4e90f3550213 100644 (file)
@@ -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:
This page took 0.02514 seconds and 4 git commands to generate.