diff options
Diffstat (limited to 'rbutil/jztool')
-rw-r--r-- | rbutil/jztool/Makefile | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/rbutil/jztool/Makefile b/rbutil/jztool/Makefile index bc2724ef59..5e397c59aa 100644 --- a/rbutil/jztool/Makefile +++ b/rbutil/jztool/Makefile | |||
@@ -25,15 +25,23 @@ ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32) | |||
25 | # TODO: support Windows | 25 | # TODO: support Windows |
26 | else | 26 | else |
27 | ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) | 27 | ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) |
28 | # OSX -- /opt location is cheesy attempt to support ARM macs | 28 | # Mac, tested on x86 only -- may need to adjust paths if building on ARM. |
29 | # COMPLETELY UNTESTED, testing from someone with an actual Mac is appreciated! | 29 | # paths should work with homebrew libusb. |
30 | CFLAGS += -I/usr/local/include -I/opt/homebrew/include | 30 | LIBUSB_CFLAGS ?= -I/usr/local/include/libusb-1.0 |
31 | LDOPTS += -L/usr/local/lib -L/opt/homebrew/lib -lusb-1.0 | 31 | ifdef STATIC |
32 | LIBUSB_LDOPTS ?= /usr/local/lib/libusb-1.0.a -framework IOKit -framework CoreFoundation | ||
32 | else | 33 | else |
33 | # Linux | 34 | LIBUSB_LDOPTS ?= -L/usr/local/lib -lusb-1.0 |
34 | CFLAGS += `pkg-config --cflags libusb-1.0` | 35 | endif |
35 | LDOPTS += `pkg-config --libs libusb-1.0` | 36 | else |
37 | # Linux; note for static builds you need to build a copy of libusb without | ||
38 | # udev support and specify the includes / libs manually | ||
39 | LIBUSB_CFLAGS ?= `pkg-config --cflags libusb-1.0` | ||
40 | LIBUSB_LDOPTS ?= `pkg-config --libs libusb-1.0` | ||
36 | endif | 41 | endif |
37 | endif | 42 | endif |
38 | 43 | ||
44 | CFLAGS += $(LIBUSB_CFLAGS) | ||
45 | LDOPTS += $(LIBUSB_LDOPTS) | ||
46 | |||
39 | include ../libtools.make | 47 | include ../libtools.make |