kinect_upload_fw: specify libraries after objects in the linking command
authorAntonio Ospite <ospite@studenti.unina.it>
Sat, 26 Nov 2011 23:34:57 +0000 (00:34 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Sat, 26 Nov 2011 23:43:13 +0000 (00:43 +0100)
commit863d1b3bdc8ce5dd9d85db85165fdd08eb46170a
tree37092c32252b2302c71896db845f6156cfa0ffa6
parent54b0fdd2357b27cff1861cbe7d62581147a5fad0
kinect_upload_fw: specify libraries after objects in the linking command

When some options, like -Wl,--as-needed, are passed to the compiler (and
then to the liker) the order of linking options becomes important:
libraries must be specified after the objects in the linking command.

The implicit rule used was more or less:
  kinect_upload_fw: kinect_upload_fw.o
      $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@

with LDFLAGS expanded before $^ (the objects); use LDLIBS to specify the
libraries instead, which is expanded after $^.

More details in
http://ao2.it/it/blog/2011/11/27/dont-mix-ldflags-and-ldlibs
kinect_upload_fw/Makefile