summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-03-04 11:35:53 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-03-04 11:35:53 +0300
commite6eff4a5c27ffb4a44aa68b6364af4ea07efc610 (patch)
tree47f4a55c49e6b63d9d981fe2a33bb4e0c2f8e8b1
parentc50f068782fc0ef4f653710d872dc7161022e9c3 (diff)
downloadtakethis-e6eff4a5c27ffb4a44aa68b6364af4ea07efc610.tar
takethis-e6eff4a5c27ffb4a44aa68b6364af4ea07efc610.tar.xz
takethis-e6eff4a5c27ffb4a44aa68b6364af4ea07efc610.zip
Makefile fix.
-rw-r--r--Makefile9
1 files 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