summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
54b0fdd)
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
-Wwrite-strings
CFLAGS += $(shell pkg-config --cflags libusb-1.0)
-Wwrite-strings
CFLAGS += $(shell pkg-config --cflags libusb-1.0)
-LDFLAGS += $(shell pkg-config --libs libusb-1.0)
+LDLIBS += $(shell pkg-config --libs libusb-1.0)
PREFIX ?= /usr/local
bindir := $(PREFIX)/sbin
PREFIX ?= /usr/local
bindir := $(PREFIX)/sbin