Makefile.os2: build libm as a static lib and add it to linkage.
authorOzkan Sezer
Sun, 18 Nov 2018 11:50:02 +0300
changeset 124198fd9d8eeb968
parent 12418 03fc24848a71
child 12420 4a6c91d9cc33
Makefile.os2: build libm as a static lib and add it to linkage.

in case it is needed some day.
Makefile.os2
     1.1 --- a/Makefile.os2	Sat Nov 17 16:24:52 2018 -0500
     1.2 +++ b/Makefile.os2	Sun Nov 18 11:50:02 2018 +0300
     1.3 @@ -15,7 +15,8 @@
     1.4  INCPATH+= -I"$(LIBHOME)/h"
     1.5  INCPATH+= -Iinclude
     1.6  
     1.7 -LIBS = mmpm2.lib libuls.lib libconv.lib
     1.8 +LIBM = libm.lib
     1.9 +LIBS = mmpm2.lib libuls.lib libconv.lib $(LIBM)
    1.10  
    1.11  CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
    1.12  # max warnings:
    1.13 @@ -27,6 +28,10 @@
    1.14  # building SDL itself:
    1.15  CFLAGS+= -DBUILD_SDL
    1.16  
    1.17 +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 &
    1.18 +       k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
    1.19 +       s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
    1.20 +
    1.21  SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
    1.22  SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
    1.23  SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
    1.24 @@ -56,6 +61,7 @@
    1.25  SRCS+= SDL_dynapi.c
    1.26  
    1.27  OBJS = $(SRCS:.c=.obj)
    1.28 +MOBJS= $(MSRCS:.c=.obj)
    1.29  
    1.30  .extensions:
    1.31  .extensions: .lib .dll .obj .c .asm
    1.32 @@ -66,7 +72,7 @@
    1.33  
    1.34  all: $(DLLFILE) $(LIBFILE) .symbolic
    1.35  
    1.36 -$(DLLFILE): $(OBJS) $(LNKFILE)
    1.37 +$(DLLFILE): $(OBJS) $(LIBM) $(LNKFILE)
    1.38      @echo * Linking: $@
    1.39      wlink @$(LNKFILE)
    1.40  
    1.41 @@ -95,6 +101,10 @@
    1.42  SDL_RLEaccel.obj: SDL_RLEaccel.c
    1.43      wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
    1.44  
    1.45 +.c: ./src/libm;
    1.46 +$(LIBM): $(MOBJS)
    1.47 +    wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
    1.48 +
    1.49  $(LNKFILE):
    1.50      @echo * Creating linker file: $@
    1.51      @%create $@
    1.52 @@ -118,6 +128,7 @@
    1.53      @if exist *.obj rm *.obj
    1.54      @if exist *.err rm *.err
    1.55      @if exist $(LNKFILE) rm $(LNKFILE)
    1.56 +    @if exist $(LIBM) rm $(LIBM)
    1.57  
    1.58  distclean: .SYMBOLIC clean
    1.59      @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp