From e6eff4a5c27ffb4a44aa68b6364af4ea07efc610 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Thu, 4 Mar 2021 11:35:53 +0300 Subject: Makefile fix. --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1e19847..6065aa8 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ DEBUG ?= no # Specify your favourite C compiler here: COMPILE ?= gcc +# Are you on Windows? +WINDOWS ?= no # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -16,8 +18,11 @@ CFLAGS += -g -O0 else CFLAGS += -O2 endif +ifeq '$(WINDOWS)' 'yes' +LFLAGS = -mwindows -lmingw32 +endif # Use SDL: -LFLAGS = -lSDL2 -lSDL2_ttf -lSDL2_mixer -lm +LFLAGS += -lSDL2main -lSDL2 -lSDL2_ttf -lSDL2_mixer -lm # Directories definitions: BUILD = build @@ -49,7 +54,7 @@ clean: # Packing object files into library: $(GAME): $(OBJ) - $(COMPILE) $(LFLAGS) $^ -o $@ + $(COMPILE) -o $@ $^ $(LFLAGS) # Compile object files from corresponding source: $(BUILD)/%.o: $(SRCDIR)/%.c -- cgit v1.2.3