sdl12-compat: added a standalone linux makefile to make my life easier

From 08498ff1eebeaa823136d92e8190449f2f23fe09 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 14 Apr 2021 17:56:50 +0300
Subject: [PATCH] added a standalone linux makefile to make my life easier

---
 src/Makefile.linux | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 src/Makefile.linux

diff --git a/src/Makefile.linux b/src/Makefile.linux
new file mode 100644
index 0000000..0f5d859
--- /dev/null
+++ b/src/Makefile.linux
@@ -0,0 +1,38 @@
+# GNU Makefile for Linux (Unix) to build SDL12-compat.
+#
+
+# change INCLUDES so it points to SDL2 headers directory:
+INCLUDES = -Iinclude
+
+CC=gcc
+LD = $(CC)
+
+CPPFLAGS = -DNDEBUG -D_THREAD_SAFE -D_REENTRANT
+
+CFLAGS  = -fPIC -O3 -Wall
+LDFLAGS = -shared -Wl,-soname,libSDL-1.2.so.0
+#make sure this is supported:
+LDFLAGS+= -Wl,--no-undefined
+LDLIBS  = -ldl
+
+SHLIB = libSDL-1.2.so.1.2.50
+
+OBJ = SDL12_compat.o
+
+.SUFFIXES:
+.SUFFIXES: .o .c .m
+
+all: $(SHLIB)
+
+$(SHLIB): $(OBJ)
+	$(LD) -o $@ $(LDFLAGS) $(OBJ) $(LDLIBS)
+	ln -s $(SHLIB) libSDL-1.2.so
+	ln -s $(SHLIB) libSDL-1.2.so.0
+
+.c.o:
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -o $@ -c $<
+
+distclean: clean
+	$(RM) *.so*
+clean:
+	$(RM) *.o