From ce0197424340801014f8e2e7f93f7ae4f0c80a11 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Tue, 15 Oct 2024 01:06:52 -0400 Subject: [PATCH] Fix windows build --- .gitattributes | 12 ++++++++++++ .gitignore | 4 ++-- .gitmodules | 2 +- README.md | 28 ++++++++++++++-------------- game.h | 2 +- main.c | 2 +- makefile | 34 +++++++++++++++++----------------- shrooms-vb-core | 1 + 8 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 .gitattributes create mode 160000 shrooms-vb-core diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..061d577 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +*.c text eol=lf diff=c +*.css text eol=lf diff=css +*.h text eol=lf diff=c +*.html text eol=lf diff=html +*.java text eol=lf diff=java +*.js text eol=lf diff=js +*.txt text eol=lf + +*.class binary +*.dll binary +*.wasm binary +*.woff2 binary \ No newline at end of file diff --git a/.gitignore b/.gitignore index 57dffd7..3af78ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/shrooms-vb -/shrooms-vb.exe +/shrooms-vb +/shrooms-vb.exe .vscode \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index d683365..417dff1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "shrooms-vb-core"] +[submodule "shrooms-vb-core"] path = shrooms-vb-core url = https://git.virtual-boy.com/PVB/shrooms-vb-core.git diff --git a/README.md b/README.md index e1bc941..35758eb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# Shrooms VB (native) - -An SDL-based implementation of shrooms-vb. - -## Setup - -Install the following dependencies: - - `gcc` (or MinGW on Windows) (or whatever, just set `CC`) - - `pkg-config` - - sdl2 - -Run -```sh -make build +# Shrooms VB (native) + +An SDL-based implementation of shrooms-vb. + +## Setup + +Install the following dependencies: + - `gcc` (or MinGW on Windows) (or whatever, just set `CC`) + - `pkg-config` + - sdl2 + +Run +```sh +make build ``` \ No newline at end of file diff --git a/game.h b/game.h index 39a1125..fe292d4 100644 --- a/game.h +++ b/game.h @@ -1,7 +1,7 @@ #ifndef SHROOMS_VB_NATIVE_GAME_ #define SHROOMS_VB_NATIVE_GAME_ -#include +#include "shrooms-vb-core/core/vb.h" int runGame(VB *sim); diff --git a/main.c b/main.c index d7569d0..4174a74 100644 --- a/main.c +++ b/main.c @@ -97,4 +97,4 @@ int main(int argc, char **argv) { SDL_Quit(); return status; -} \ No newline at end of file +} diff --git a/makefile b/makefile index 1ed9007..48ff4c6 100644 --- a/makefile +++ b/makefile @@ -1,18 +1,18 @@ -CC?=gcc -SHROOMSFLAGS=shrooms-vb-core/core/vb.c -I shrooms-vb-core/core -SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) - -.PHONY: clean -clean: -ifeq ($(OS),WINDOWS_NT) - @del shrooms-vb.exe -else - @rm -f shrooms-vb -endif - -build: - @$(CC) cli.c game.c main.c -I . \ - $(SHROOMSFLAGS) $(SDL2FLAGS) \ - -D POSIX_C_SOURCE=199309L \ - -o shrooms-vb \ +CC?=gcc +SHROOMSFLAGS=shrooms-vb-core/core/vb.c -I shrooms-vb-core/core +SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) + +.PHONY: clean +clean: +ifeq ($(OS),WINDOWS_NT) + @del shrooms-vb.exe +else + @rm -f shrooms-vb +endif + +build: + @$(CC) cli.c game.c main.c -I . \ + $(SHROOMSFLAGS) $(SDL2FLAGS) \ + -D POSIX_C_SOURCE=199309L \ + -o shrooms-vb \ -Werror -std=c90 -Wall -Wextra -Wpedantic \ No newline at end of file diff --git a/shrooms-vb-core b/shrooms-vb-core new file mode 160000 index 0000000..767675e --- /dev/null +++ b/shrooms-vb-core @@ -0,0 +1 @@ +Subproject commit 767675eb42254613170e937b5b67bd9c109a9cf8