Merge latest bugfixes
[SCSI2SD.git] / software / bootloaderhost / Makefile
1 all:  build/bootloaderhost
2
3 CYAPI = \
4         cybootloaderutils/cybtldr_api2.c \
5         cybootloaderutils/cybtldr_api.c \
6         cybootloaderutils/cybtldr_command.c \
7         cybootloaderutils/cybtldr_parse.c \
8
9 CFLAGS += -Wall -Wno-pointer-sign
10
11 UNAME_S := $(shell uname -s)
12 ifeq ($(UNAME_S),Linux)
13         HID_C = hidapi/linux/hid.c
14         LDFLAGS += -ludev
15 endif
16 ifeq ($(UNAME_S),Darwin)
17         # Should match OSX
18         HID_C = hidapi/mac/hid.c
19         LDFLAGS += -framework IOKit -framework CoreFoundation
20         CFLAGS += -mmacosx-version-min=10.5 -arch x86_64 -arch i386 -arch ppc -isysroot /Xcode3.1.4/SDKs/MacOSX10.5.sdk
21         CC=/Xcode3.1.4/usr/bin/gcc
22 endif
23
24
25 build/bootloaderhost: main.c $(HID_C) $(CYAPI)
26         mkdir -p $(dir $@)
27         $(CC) $(CFLAGS) -I cybootloaderutils -I hidapi/hidapi $^ $(LDFLAGS) -o $@
28
29 clean:
30         rm build/bootloaderhost