Add support for cross-compiling for Windows

This commit is contained in:
Ry 2022-12-26 17:22:48 -08:00
parent 3246859ff2
commit 30f76602a7
10 changed files with 18 additions and 10 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <math.h>
#include <stdarg.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <math.h>
#include <stdarg.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <math.h>
#include <stdarg.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <math.h>
#include <stdarg.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <stdarg.h>
#include <stdbool.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <math.h>
#include <stdarg.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <math.h>
#include <stdarg.h>

View File

@ -1,4 +1,4 @@
#include <SDL.h>
#include <SDL2/SDL.h>
#include <getopt.h>
#include <stdarg.h>
#include <stdbool.h>

View File

@ -1,6 +1,6 @@
#pragma once
#include <SDL.h>
#include <SDL2/SDL.h>
struct Screen;