From 905acddfdaa1b3a3d56484f6b461fe899677a59e Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Wed, 2 Mar 2022 20:22:06 +0000 Subject: [PATCH] Improve the OpenWatcom makefiles --- Makefile.os2 | 30 ++++++++++++++++++++++++------ Makefile.w32 | 30 ++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/Makefile.os2 b/Makefile.os2 index a2ba596..28188a1 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -1,14 +1,32 @@ # Makefile for OS/2 using Watcom compiler. # # wmake -f Makefile.os2 +# - builds using libxmp.dll and its import lib (libxmp.lib) +# +# wmake -f Makefile.os2 target=static +# - builds using the static library xmp_static.lib +# +!ifndef target +target = dll +!endif +!ifndef libxmp_path +libxmp_path = ../libxmp +!endif CC=wcc386 +SYSTEM=os2v2 + CPPFLAGS=-DHAVE_SIGNAL_H -DHAVE_STRINGS_H CPPFLAGS+= -DSOUND_OS2DART -INCLUDES=-I"src/watcom" -Isrc - -#LIBXMP=xmp_static.lib -LIBXMP=libxmp.lib +INCLUDES=-I"src/watcom" -Isrc -I"$(%WATCOM)/h" -I"$(%WATCOM)/h/os2" + +!ifeq target static +CPPFLAGS+= -DBUILDING_STATIC +LIBXMP=$(libxmp_path)/xmp_static.lib +!else +LIBXMP=$(libxmp_path)/libxmp.lib +!endif +INCLUDES+= -I"$(libxmp_path)/include" LIBS=$(LIBXMP) # for sound_dart: LIBS+= mmpm2.lib @@ -30,8 +48,8 @@ OBJ = commands.obj delay.obj getopt_long.obj info.obj main.obj options.obj read_ all: $(AOUT) -$(AOUT): $(OBJ) - wlink N $(AOUT) SYS OS2V2 OP QUIET LIBR {$(LIBS)} F {$(OBJ)} +$(AOUT): $(OBJ) $(LIBXMP) + wlink N $(AOUT) SYS $(SYSTEM) OP QUIET LIBR {$(LIBS)} F {$(OBJ)} .c: src .c.obj: diff --git a/Makefile.w32 b/Makefile.w32 index f608711..7487973 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -1,14 +1,32 @@ # Makefile for Win32 using Watcom compiler. # # wmake -f Makefile.w32 +# - builds using libxmp.dll and its import lib (libxmp.lib) +# +# wmake -f Makefile.w32 target=static +# - builds using the static library xmp_static.lib +# +!ifndef target +target = dll +!endif +!ifndef libxmp_path +libxmp_path = ../libxmp +!endif CC=wcc386 +SYSTEM=nt + CPPFLAGS=-DHAVE_SIGNAL_H -DHAVE_STRINGS_H CPPFLAGS+= -DSOUND_WIN32 -INCLUDES=-I"src/win32" -Isrc -I"$(%WATCOM)/h/nt" - -#LIBXMP=xmp_static.lib -LIBXMP=libxmp.lib +INCLUDES=-I"src/win32" -Isrc -I"$(%WATCOM)/h" -I"$(%WATCOM)/h/nt" + +!ifeq target static +CPPFLAGS+= -DBUILDING_STATIC +LIBXMP=$(libxmp_path)/xmp_static.lib +!else +LIBXMP=$(libxmp_path)/libxmp.lib +!endif +INCLUDES+= -I"$(libxmp_path)/include" LIBS=$(LIBXMP) # for sound_win32: LIBS+= winmm.lib @@ -30,8 +48,8 @@ OBJ = commands.obj delay.obj getopt_long.obj info.obj main.obj options.obj read_ all: $(AOUT) -$(AOUT): $(OBJ) - wlink N $(AOUT) SYS NT OP QUIET LIBR {$(LIBS)} F {$(OBJ)} +$(AOUT): $(OBJ) $(LIBXMP) + wlink N $(AOUT) SYS $(SYSTEM) OP QUIET LIBR {$(LIBS)} F {$(OBJ)} .c: src .c.obj: