From eb44a075db6b454bb5074d2d0d38284ee9c44a60 Mon Sep 17 00:00:00 2001 From: Bernhard Nortmann Date: Wed, 26 Oct 2016 19:49:32 +0200 Subject: [PATCH] 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 --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4771bf9..6adf0b8 100644 --- a/Makefile +++ b/Makefile @@ -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