diff options
Diffstat (limited to 'rbutil/mks5lboot/Makefile')
-rw-r--r-- | rbutil/mks5lboot/Makefile | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/rbutil/mks5lboot/Makefile b/rbutil/mks5lboot/Makefile index ba118eefd0..72ea521d5f 100644 --- a/rbutil/mks5lboot/Makefile +++ b/rbutil/mks5lboot/Makefile | |||
@@ -4,6 +4,7 @@ | |||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
6 | # \/ \/ \/ \/ \/ | 6 | # \/ \/ \/ \/ \/ |
7 | CC := gcc | ||
7 | CFLAGS += -Wall -Wextra | 8 | CFLAGS += -Wall -Wextra |
8 | 9 | ||
9 | OUTPUT = mks5lboot | 10 | OUTPUT = mks5lboot |
@@ -15,18 +16,25 @@ SOURCES := $(LIBSOURCES) main.c | |||
15 | # dependencies for binary | 16 | # dependencies for binary |
16 | EXTRADEPS := | 17 | EXTRADEPS := |
17 | 18 | ||
18 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | 19 | CPPDEFINES := $(shell echo foo | $(CROSS)$(CC) -dM -E -) |
20 | |||
21 | ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32) | ||
19 | LDOPTS += -lsetupapi | 22 | LDOPTS += -lsetupapi |
20 | # optional libusb support on Windows | 23 | # optional libusb support (needed for WinUSB and libusbK drivers) |
21 | ifdef DISABLE_LIBUSBAPI | 24 | ifeq ($(findstring MINGW,$(CPPDEFINES)),MINGW) |
22 | CFLAGS += -DNO_LIBUSBAPI | 25 | ifeq ($(USE_LIBUSBAPI),1) |
23 | else | 26 | CFLAGS += -DUSE_LIBUSBAPI |
24 | LDOPTS += -Wl,-Bstatic -lusb-1.0 | 27 | LDOPTS += -Wl,-Bstatic -lusb-1.0 |
25 | endif | 28 | endif |
29 | endif | ||
26 | else | 30 | else |
27 | # Linux, OS X | 31 | ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) |
32 | LDOPTS += -L/usr/local/lib -framework IOKit -framework CoreFoundation | ||
33 | else # Linux | ||
34 | CFLAGS += -DUSE_LIBUSBAPI | ||
28 | LDOPTS += -lusb-1.0 | 35 | LDOPTS += -lusb-1.0 |
29 | endif | 36 | endif |
37 | endif | ||
30 | 38 | ||
31 | include ../libtools.make | 39 | include ../libtools.make |
32 | 40 | ||