Makefile.os2
author Manuel Alfayate Corchete
Sat, 26 Sep 2020 19:18:09 +0200
changeset 14057 c9b9ade35084
parent 13819 b7408e977034
permissions -rw-r--r--
kmsdrm: merge patches from Ozkan Sezer for removing c-99'isms and raising libgbm version reqeriments.
     1 # Open Watcom makefile to build SDL2.dll for OS/2
     2 # wmake -f Makefile.os2
     3 
     4 LIBNAME = SDL2
     5 VERSION = 2.0.13
     6 DESCRIPTION = Simple DirectMedia Layer 2
     7 
     8 LIBHOME = .
     9 LIBPATH = $(LIBHOME)/lib
    10 DLLFILE = $(LIBHOME)/$(LIBNAME).dll
    11 LIBFILE = $(LIBHOME)/$(LIBNAME).lib
    12 LNKFILE = $(LIBNAME).lnk
    13 
    14 INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
    15 INCPATH+= -I"$(LIBHOME)/h"
    16 INCPATH+= -Iinclude
    17 
    18 LIBM = libm.lib
    19 LIBS = mmpm2.lib libuls.lib libconv.lib $(LIBM)
    20 
    21 CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
    22 # max warnings:
    23 CFLAGS+= -wx
    24 # building dll:
    25 CFLAGS+= -bd
    26 # the include paths :
    27 CFLAGS+= $(INCPATH)
    28 # building SDL itself (for DECLSPEC):
    29 CFLAGS+= -DBUILD_SDL
    30 
    31 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 &
    32        k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
    33        s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
    34 
    35 SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
    36 SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c
    37 SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
    38 SRCS+= SDL_rwops.c SDL_power.c
    39 SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
    40 SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
    41        SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
    42        SDL_sensor.c SDL_touch.c
    43 SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
    44 SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
    45        SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
    46        SDL_render_sw.c SDL_rotate.c
    47 SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
    48        SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
    49        SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
    50        SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
    51 
    52 SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
    53 SRCS+= SDL_systimer.c
    54 SRCS+= SDL_sysloadso.c
    55 SRCS+= SDL_sysfilesystem.c
    56 SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
    57 SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
    58 SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
    59 SRCS+= SDL_dummysensor.c
    60 
    61 SRCS+= SDL_dynapi.c
    62 
    63 SRCS+= SDL_locale.c SDL_syslocale.c
    64 
    65 OBJS = $(SRCS:.c=.obj)
    66 MOBJS= $(MSRCS:.c=.obj)
    67 
    68 .extensions:
    69 .extensions: .lib .dll .obj .c .asm
    70 
    71 .c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk;
    72 .c: ./src/haptic/dummy;./src/joystick/dummy;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
    73 .c: ./src/loadso/dummy;./src/filesystem/dummy;./src/timer/dummy;./src/thread/generic;./src/locale/;./src/locale/unix
    74 
    75 all: $(DLLFILE) $(LIBFILE) .symbolic
    76 
    77 $(DLLFILE): $(OBJS) $(LIBM) $(LNKFILE)
    78     @echo * Linking: $@
    79     wlink @$(LNKFILE)
    80 
    81 $(LIBFILE): $(DLLFILE)
    82     @echo * Creating LIB file: $@
    83     wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
    84 
    85 .c.obj:
    86     wcc386 $(CFLAGS) -fo=$^@ $<
    87 
    88 SDL_cpuinfo.obj: SDL_cpuinfo.c
    89     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    90 
    91 SDL_rwops.obj: SDL_rwops.c
    92     wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
    93 
    94 SDL_wave.obj: SDL_wave.c
    95     wcc386 $(CFLAGS) -wcd=124 -fo=$^@ $<
    96 
    97 SDL_blendfillrect.obj: SDL_blendfillrect.c
    98     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    99 
   100 SDL_blendline.obj: SDL_blendline.c
   101     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
   102 
   103 SDL_blendpoint.obj: SDL_blendpoint.c
   104     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
   105 
   106 SDL_RLEaccel.obj: SDL_RLEaccel.c
   107     wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
   108 
   109 .c: ./src/libm;
   110 $(LIBM): $(MOBJS)
   111     wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
   112 
   113 $(LNKFILE):
   114     @echo * Creating linker file: $@
   115     @%create $@
   116     @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
   117     @%append $@ NAME $(DLLFILE)
   118     @for %i in ($(OBJS)) do @%append $@ FILE %i
   119     @%append $@ LIBPATH $(%LIB);$(LIBPATH)
   120     @for %i in ($(LIBS)) do @%append $@ LIB %i
   121     @%append $@ OPTION QUIET
   122     @%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
   123     @%append $@ OPTION MAP=$(LIBHOME)/$^&.map
   124     @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
   125     @%append $@ OPTION QUIET
   126     @%append $@ OPTION ELIMINATE
   127     @%append $@ OPTION MANYAUTODATA
   128     @%append $@ OPTION OSNAME='OS/2 and eComStation'
   129     @%append $@ OPTION SHOWDEAD
   130 
   131 clean: .SYMBOLIC
   132     @ echo * Clean: $(LIBNAME)
   133     @if exist *.obj rm *.obj
   134     @if exist *.err rm *.err
   135     @if exist $(LNKFILE) rm $(LNKFILE)
   136     @if exist $(LIBM) rm $(LIBM)
   137 
   138 distclean: .SYMBOLIC clean
   139     @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
   140     @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
   141     @if exist $(LIBFILE) rm $(LIBFILE)
   142     @if exist $(DLLFILE) rm $(DLLFILE)