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

