Added Windows support for the bootloaderhost utility
authorMichael McMaster <michael@codesrc.com>
Mon, 28 Oct 2013 11:08:29 +0000 (21:08 +1000)
committerMichael McMaster <michael@codesrc.com>
Mon, 28 Oct 2013 11:08:29 +0000 (21:08 +1000)
Compile on Linux using the mingw cross compiler.

software/bootloaderhost/Makefile.mingw [new file with mode: 0644]

diff --git a/software/bootloaderhost/Makefile.mingw b/software/bootloaderhost/Makefile.mingw
new file mode 100644 (file)
index 0000000..820212f
--- /dev/null
@@ -0,0 +1,25 @@
+all:  build/windows/32bit/bootloaderhost.exe build/windows/64bit/bootloaderhost.exe
+
+CYAPI = \
+       cybootloaderutils/cybtldr_api2.c \
+       cybootloaderutils/cybtldr_api.c \
+       cybootloaderutils/cybtldr_command.c \
+       cybootloaderutils/cybtldr_parse.c \
+
+CFLAGS += -Wall -Wno-pointer-sign
+LDFLAGS=-mconsole -mwindows -lsetupapi
+
+HID_C = hidapi/windows/hid.c
+
+
+build/windows/32bit/bootloaderhost.exe: main.c $(HID_C) $(CYAPI)
+       mkdir -p $(dir $@)
+       i686-w64-mingw32-gcc $(CFLAGS) -I cybootloaderutils -I hidapi/hidapi $^ $(LDFLAGS) -o $@
+
+build/windows/64bit/bootloaderhost.exe: main.c $(HID_C) $(CYAPI)
+       mkdir -p $(dir $@)
+       x86_64-w64-mingw32-gcc $(CFLAGS) -I cybootloaderutils -I hidapi/hidapi $^ $(LDFLAGS) -o $@
+
+clean:
+       rm -r build/windows
+