From 075d119ab373c2bcdc447a3f07dc1dfb7229fca6 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Wed, 23 Oct 2024 20:01:22 -0400 Subject: [PATCH] Run on windows OR unix --- makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 4b50bb5..d79d30e 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,13 @@ CC?=gcc LD?=ld SHROOMSFLAGS=shrooms-vb-core/core/vb.c -I shrooms-vb-core/core -SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) -mconsole +msys_version := $(if $(findstring Msys, $(shell uname -o)),$(word 1, $(subst ., ,$(shell uname -r))),0) + +ifeq ($(msys_version), 0) +SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) +else +SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs) -mwindows -mconsole +endif .PHONY: clean build clean: @@ -34,7 +40,7 @@ output/vb.o: shrooms-vb-core/core/vb.c output/%.o: assets/%.bin @mkdir -p output - @$(LD) -r -b binary -o $@ $< + @$(LD) -r -b binary -z noexecstack -o $@ $< shrooms-vb: $(OFILES) @$(CC) -o $@ $(OFILES) $(SDL2FLAGS) -flto