From 08c4ed5b9f5a9aef6051c510fa99d85c1a99263b Mon Sep 17 00:00:00 2001 From: Jason Bou-Samra <154414066+bou-samra@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:08:01 +1100 Subject: [PATCH] Update Makefile --- src/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Makefile b/src/Makefile index 40daf4a..927a72b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,24 @@ #! /bin/make # :vim: set noexpandtab: +ifeq ($(OS),Windows_NT) + detected_OS := Windows +else + detected_OS := $(shell uname -s) +endif + +$(info Detected OS: $(detected_OS)) +ifeq ($(detected_OS),Darwin) + +# brew install libsodium +# brew install sdl2 +# brew install sdl2_image + +CFLAGS = -lm `sdl2-config --cflags --libs` -lsodium -lsdl2 -lsdl2_image -I/opt/homebrew/include -L/opt/homebrew/lib +else CFLAGS = -lm -lSDL2_image `sdl2-config --cflags --libs` -lsodium -s +endif + columns: main.c column.c research.c render.c backdrop.c sdl.c events.c hiscore.c text.c menu.c level.c column.h research.h render.h backdrop.h sdl.h events.h hiscore.h text.h menu.h sprite_sheet.h level.h $(CC) main.c column.c research.c render.c backdrop.c sdl.c events.c hiscore.c text.c menu.c level.c -o columns $(CFLAGS)