sdl12-compat: Add makefiles for building the tests with OpenWatcom

From 270afba867be52d2d0074fbf3f14dc1bbe872dfe Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Sat, 24 Sep 2022 13:44:11 +0100
Subject: [PATCH] Add makefiles for building the tests with OpenWatcom

---
 test/Makefile.os2 | 34 ++++++++++++++++++++++++++++++++++
 test/Makefile.w32 | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 test/Makefile.os2
 create mode 100644 test/Makefile.w32

diff --git a/test/Makefile.os2 b/test/Makefile.os2
new file mode 100644
index 00000000..5f45c258
--- /dev/null
+++ b/test/Makefile.os2
@@ -0,0 +1,34 @@
+TARGETS = checkkeys.exe graywin.exe loopwave.exe testalpha.exe testbitmap.exe &
+          testblitspeed.exe testcdrom.exe testcursor.exe testdyngl.exe &
+          testerror.exe testfile.exe testgamma.exe testgl.exe testthread.exe &
+          testiconv.exe testjoystick.exe testkeys.exe testlock.exe &
+          testoverlay2.exe testoverlay.exe testpalette.exe testplatform.exe &
+          testsem.exe testsprite.exe testtimer.exe testver.exe testvidinfo.exe &
+          testwin.exe testwm.exe threadwin.exe torturethread.exe testloadso.exe
+
+OBJS = $(TARGETS:.exe=.obj)
+
+all: $(TARGETS)
+
+BINPATH = .
+INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h" -I"../include/SDL"
+CFLAGS_DEF = $(INCPATH) -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier
+CFLAGS_EXE = $(CFLAGS_DEF)
+CFLAGS = $(CFLAGS_EXE) -ei -5s
+
+LIBPATH = ../src
+LIBS = SDL12.lib
+
+.obj.exe:
+  wlink SYS os2v2 libpath $(LIBPATH) lib {$(LIBS)} op q file {$<} name $*
+
+.c.obj:
+  wcc386 $(CFLAGS) -fo=$^@ $<
+
+clean: .SYMBOLIC
+  @echo * Clean tests in $(BINPATH)
+  @if exist *.obj rm *.obj
+  @if exist *.err rm *.err
+
+distclean: clean .SYMBOLIC
+  @if exist *.exe rm *.exe
diff --git a/test/Makefile.w32 b/test/Makefile.w32
new file mode 100644
index 00000000..793031c2
--- /dev/null
+++ b/test/Makefile.w32
@@ -0,0 +1,35 @@
+TARGETS = checkkeys.exe graywin.exe loopwave.exe testalpha.exe testbitmap.exe &
+          testblitspeed.exe testcdrom.exe testcursor.exe testdyngl.exe &
+          testerror.exe testfile.exe testgamma.exe testgl.exe testthread.exe &
+          testiconv.exe testjoystick.exe testkeys.exe testlock.exe &
+          testoverlay2.exe testoverlay.exe testpalette.exe testplatform.exe &
+          testsem.exe testsprite.exe testtimer.exe testver.exe testvidinfo.exe &
+          testwin.exe testwm.exe threadwin.exe torturethread.exe testloadso.exe
+
+OBJS = $(TARGETS:.exe=.obj)
+
+all: $(TARGETS)
+
+BINPATH = .
+INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h" -I"../include/SDL"
+CFLAGS_DEF = $(INCPATH) -bt=nt -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier
+CFLAGS_EXE = $(CFLAGS_DEF)
+CFLAGS = $(CFLAGS_EXE) -ei -5s
+
+LIBPATH = ../src
+LIBS = SDL.lib
+LIBF = SDLmain.lib
+
+.obj.exe:
+  wlink SYS nt libpath $(LIBPATH) libf {$(LIBF)} lib {$(LIBS)} op q file {$<} name $*
+
+.c.obj:
+  wcc386 $(CFLAGS) -fo=$^@ $<
+
+clean: .SYMBOLIC
+  @echo * Clean tests in $(BINPATH)
+  @if exist *.obj rm *.obj
+  @if exist *.err rm *.err
+
+distclean: clean .SYMBOLIC
+  @if exist *.exe rm *.exe