From 91d3e09d944b116a7d0ff63837d0609314331a55 Mon Sep 17 00:00:00 2001 From: sezero Date: Sat, 3 Dec 2016 01:37:32 +0300 Subject: [PATCH] provide a Makefile.os2 (to be used with Watcom, tested with OpenWatcom 1.9) --- Makefile.am | 2 +- os2/Makefile.os2 | 37 +++++++++++++++++++++++++++++++++++++ os2/unistd.h | 8 ++++++++ os2/usleep.c | 6 ++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 os2/Makefile.os2 create mode 100644 os2/unistd.h create mode 100644 os2/usleep.c diff --git a/Makefile.am b/Makefile.am index d920600..8eaf85e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,4 +2,4 @@ SUBDIRS = src -EXTRA_DIST = CREDITS Changelog girl_from_mars.xm +EXTRA_DIST = CREDITS Changelog girl_from_mars.xm os2/Makefile.os2 os2/unistd.h os2/usleep.c diff --git a/os2/Makefile.os2 b/os2/Makefile.os2 new file mode 100644 index 0000000..05ba15d --- /dev/null +++ b/os2/Makefile.os2 @@ -0,0 +1,37 @@ +# Makefile for OS/2 using Watcom compiler. +# +# wmake -f Makefile.os2 + +CC=wcc386 +INCLUDES=-I..\os2 -I..\src +CPPFLAGS=-DHAVE_SIGNAL_H -DHAVE_SYS_TIME_H +CPPFLAGS+= -DSOUND_OS2DART +CPPFLAGS+= -DVERSION="4.2.0" +# for an exe using libxmp.dll: link to libxmp.lib +# for a statically linked exe: link to xmp_static.lib +LIBS=libxmp.lib mmpm2.lib +#LIBS=xmp_static.lib mmpm2.lib +CFLAGS = -bt=os2 -bm -fp5 -fpi87 -mf -oeatxh -w4 -zp8 -ei -q +# -5s : Pentium stack calling conventions. +# -5r : Pentium register calling conventions. +CFLAGS+= -5s + +.SUFFIXES: +.SUFFIXES: .obj .c + +AOUT=xmp.exe +COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) + +OBJ = commands.obj getopt.obj getopt1.obj info.obj main.obj options.obj read_config.obj sound.obj sound_aiff.obj sound_file.obj sound_null.obj sound_wav.obj sound_dart.obj terminal.obj usleep.obj + +all: $(AOUT) + +$(AOUT): $(OBJ) + wlink N $(AOUT) SYS OS2V2 LIBR {$(LIBS)} F {$(OBJ)} + +clean: + FOR %F IN ( $(AOUT) $(OBJ) $(EXTRA_OBJ) ) DO IF EXIST %F ERASE %F + +.c: ..\src +.c.obj: + $(COMPILE) -fo=$^@ $< diff --git a/os2/unistd.h b/os2/unistd.h new file mode 100644 index 0000000..5c3cea0 --- /dev/null +++ b/os2/unistd.h @@ -0,0 +1,8 @@ +#ifndef _XMP_OS2_UNISTD_H +#define _XMP_OS2_UNISTD_H + +#include /* do not want Watcom unistd.h */ + +void usleep (unsigned long usec); + +#endif diff --git a/os2/usleep.c b/os2/usleep.c new file mode 100644 index 0000000..f0e8a2b --- /dev/null +++ b/os2/usleep.c @@ -0,0 +1,6 @@ +#define INCL_DOSPROCESS +#include +void usleep (unsigned long usec) +{ + DosSleep(usec ? (usec/1000l) : 1l); +}