Makefile.os2: build libm as a static lib and add it to linkage. in case it is needed some day.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/Makefile.os2 b/Makefile.os2
index 95c5cef..e79f795 100644
--- a/Makefile.os2
+++ b/Makefile.os2
@@ -15,7 +15,8 @@ INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
INCPATH+= -I"$(LIBHOME)/h"
INCPATH+= -Iinclude
-LIBS = mmpm2.lib libuls.lib libconv.lib
+LIBM = libm.lib
+LIBS = mmpm2.lib libuls.lib libconv.lib $(LIBM)
CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
# max warnings:
@@ -27,6 +28,10 @@ CFLAGS+= $(INCPATH)
# building SDL itself:
CFLAGS+= -DBUILD_SDL
+MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
+ k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
+ s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
+
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
@@ -56,6 +61,7 @@ SRCS+= SDL_dummysensor.c
SRCS+= SDL_dynapi.c
OBJS = $(SRCS:.c=.obj)
+MOBJS= $(MSRCS:.c=.obj)
.extensions:
.extensions: .lib .dll .obj .c .asm
@@ -66,7 +72,7 @@ OBJS = $(SRCS:.c=.obj)
all: $(DLLFILE) $(LIBFILE) .symbolic
-$(DLLFILE): $(OBJS) $(LNKFILE)
+$(DLLFILE): $(OBJS) $(LIBM) $(LNKFILE)
@echo * Linking: $@
wlink @$(LNKFILE)
@@ -95,6 +101,10 @@ SDL_blendpoint.obj: SDL_blendpoint.c
SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
+.c: ./src/libm;
+$(LIBM): $(MOBJS)
+ wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
+
$(LNKFILE):
@echo * Creating linker file: $@
@%create $@
@@ -118,6 +128,7 @@ clean: .SYMBOLIC
@if exist *.obj rm *.obj
@if exist *.err rm *.err
@if exist $(LNKFILE) rm $(LNKFILE)
+ @if exist $(LIBM) rm $(LIBM)
distclean: .SYMBOLIC clean
@if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp