Added Mac OSX support for the bootloaderhost utility (not tested)

This commit is contained in:
Michael McMaster 2013-10-27 21:35:25 +10:00
parent 2db48d9211
commit 32a39b08be
2 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,7 @@ CYAPI = \
cybootloaderutils/cybtldr_command.c \
cybootloaderutils/cybtldr_parse.c \
CFLAGS += -Wall -Wno-pointer-sign
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
@ -15,11 +16,12 @@ endif
ifeq ($(UNAME_S),Darwin)
# Should match OSX
HID_C = hidapi/mac/hid.c
LDFLAGS += -framework IOKit -framework CoreFoundation
endif
bootloaderhost: main.c $(HID_C) $(CYAPI)
$(CC) $(CFLAGS) -g -I cybootloaderutils -I hidapi/hidapi $^ $(LDFLAGS) -o $@
$(CC) $(CFLAGS) -I cybootloaderutils -I hidapi/hidapi $^ $(LDFLAGS) -o $@
clean:
rm bootloaderhost

View File

@ -110,10 +110,10 @@ int main(int argc, char* argv[])
switch (c)
{
case 'v':
sscanf(optarg, "%x", &vendorId);
sscanf(optarg, "%hx", &vendorId);
break;
case 'p':
sscanf(optarg, "%x", &productId);
sscanf(optarg, "%hx", &productId);
break;
case '?':
usage();