From c1b785a6df59753632702133ee8a6490a026030b Mon Sep 17 00:00:00 2001 From: Mahyar Koshkouei Date: Mon, 12 Feb 2024 15:49:35 +0000 Subject: [PATCH] Makefile: simplify and use pkg-config for SDL2 This allows for improved cross-platform building. Tested working on Windows 10 in a MinGW64 (w64devkit) development environment with the following commit. Signed-off-by: Mahyar Koshkouei --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 26b84b1..d393f3d 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ -pokegb: pokegb.cc - $(CC) -O2 -Wall -Wno-return-type -Wno-misleading-indentation -Wno-parentheses -o $@ $< -lSDL2 +CXXFLAGS := -Os -s -Wall -Wno-return-type -Wno-misleading-indentation -Wno-parentheses +override CXXFLAGS += $(shell pkg-config sdl2 --cflags) +override LDLIBS += $(shell pkg-config sdl2 --libs) + +all: pokegb deobfuscated rom.sav: empty.sav cp $< $@ clean: - rm -f pokegb rom.sav + $(RM) pokegb rom.sav