Makefile: allow overriding libusb Makefile variables externally

Also: Add the winsock2 library to LIBS for Windows. When not
linking against it, the usage of WS2 conversion functions from
portable_endian.h would cause unresolved symbols.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
This commit is contained in:
Bernhard Nortmann 2016-10-26 19:49:32 +02:00
parent f3960f4a77
commit eb44a075db

View File

@ -98,11 +98,13 @@ sunxi-fexc: fexc.h script.h script.c \
script_fex.h script_fex.c
LIBUSB = libusb-1.0
LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)`
LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)`
LIBUSB_CFLAGS ?= `pkg-config --cflags $(LIBUSB)`
LIBUSB_LIBS ?= `pkg-config --libs $(LIBUSB)`
ifeq ($(OS),Windows_NT)
# Windows lacks mman.h / mmap()
DEFINES += -DNO_MMAP
# portable_endian.h relies on winsock2
LIBS += -lws2_32
endif
sunxi-fel: fel.c fel-to-spl-thunk.h progress.c progress.h