diff --git a/Makefile b/Makefile index 57d4e8e..5159d2c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ SDL2_CONFIG = sdl2-config CFLAGS = -g -Ofast -std=c99 -Wall -Wextra `$(SDL2_CONFIG) --cflags --libs` +CC_WIN = x86_64-w64-mingw32-gcc +CFLAGS_WIN = -g -Ofast -std=c99 -Wall -Wextra -lmingw32 -lSDL2main -lSDL2 TARGET=fox32 +TARGET_WIN=fox32.exe CFILES = src/main.c \ src/bus.c \ @@ -20,5 +23,10 @@ $(TARGET): $(CFILES) $(FOX32ROM_IN) sed -i -e 's/fox32_rom/fox32rom/' fox32rom.h $(CC) -o $@ $(filter %.c, $^) $(CFLAGS) +$(TARGET_WIN): $(CFILES) + xxd -i $(FOX32ROM_IN) $(FOX32ROM_OUT) + sed -i -e 's/fox32_rom/fox32rom/' fox32rom.h + $(CC_WIN) -o $@ $(filter %.c, $^) $(CFLAGS_WIN) + clean: - rm -rf fox32 + rm -rf fox32 fox32.exe diff --git a/src/bus.c b/src/bus.c index 7e8ba26..cf7bff1 100644 --- a/src/bus.c +++ b/src/bus.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/disk.c b/src/disk.c index 6ae5adb..bac0503 100644 --- a/src/disk.c +++ b/src/disk.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/framebuffer.c b/src/framebuffer.c index 50e8636..68d1332 100644 --- a/src/framebuffer.c +++ b/src/framebuffer.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/keyboard.c b/src/keyboard.c index daa6c98..a845590 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/main.c b/src/main.c index c312acb..98651bb 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/mmu.c b/src/mmu.c index 917f294..ddcdcd2 100644 --- a/src/mmu.c +++ b/src/mmu.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/mouse.c b/src/mouse.c index 561b715..26a7916 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/screen.c b/src/screen.c index fc74baa..3e71420 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/screen.h b/src/screen.h index d03cd8c..70d3cdc 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,6 +1,6 @@ #pragma once -#include +#include struct Screen;