Makefile.os2
author Ryan C. Gordon <icculus@icculus.org>
Wed, 31 Oct 2018 15:03:41 -0400
changeset 12381 dc9108cd4340
parent 12373 8feb5da6f2fb
child 12419 8fd9d8eeb968
permissions -rw-r--r--
Merge SDL-ryan-batching-renderer branch to default.
     1 # Open Watcom makefile to build SDL2.dll for OS/2:
     2 # wmake -f Makefile.os2
     3 
     4 LIBNAME = SDL2
     5 VERSION = 2.0.9
     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 LIBS = mmpm2.lib libuls.lib libconv.lib
    19 
    20 CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
    21 # max warnings:
    22 CFLAGS+= -wx
    23 # building dll:
    24 CFLAGS+= -bd
    25 # the include paths :
    26 CFLAGS+= $(INCPATH)
    27 # building SDL itself:
    28 CFLAGS+= -DBUILD_SDL
    29 
    30 SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
    31 SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
    32 SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
    33 SRCS+= SDL_rwops.c SDL_power.c
    34 SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
    35 SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
    36        SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
    37        SDL_sensor.c SDL_touch.c
    38 SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
    39 SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
    40        SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
    41        SDL_render_sw.c SDL_rotate.c
    42 SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
    43        SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
    44        SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
    45        SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
    46 
    47 SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
    48 SRCS+= SDL_systimer.c
    49 SRCS+= SDL_sysloadso.c
    50 SRCS+= SDL_sysfilesystem.c
    51 SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
    52 SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
    53 SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
    54 SRCS+= SDL_dummysensor.c
    55 
    56 SRCS+= SDL_dynapi.c
    57 
    58 OBJS = $(SRCS:.c=.obj)
    59 
    60 .extensions:
    61 .extensions: .lib .dll .obj .c .asm
    62 
    63 .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;
    64 .c: ./src/haptic/dummy;./src/joystick/dummy;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
    65 .c: ./src/loadso/dummy;./src/filesystem/dummy;./src/timer/dummy;./src/thread/generic;
    66 
    67 all: $(DLLFILE) $(LIBFILE) .symbolic
    68 
    69 $(DLLFILE): $(OBJS) $(LNKFILE)
    70     @echo * Linking: $@
    71     wlink @$(LNKFILE)
    72 
    73 $(LIBFILE): $(DLLFILE)
    74     @echo * Creating LIB file: $@
    75     wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
    76 
    77 .c.obj:
    78     wcc386 $(CFLAGS) -fo=$^@ $<
    79 
    80 SDL_cpuinfo.obj: SDL_cpuinfo.c
    81     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    82 
    83 SDL_rwops.obj: SDL_rwops.c
    84     wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
    85 
    86 SDL_blendfillrect.obj: SDL_blendfillrect.c
    87     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    88 
    89 SDL_blendline.obj: SDL_blendline.c
    90     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    91 
    92 SDL_blendpoint.obj: SDL_blendpoint.c
    93     wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    94 
    95 SDL_RLEaccel.obj: SDL_RLEaccel.c
    96     wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
    97 
    98 $(LNKFILE):
    99     @echo * Creating linker file: $@
   100     @%create $@
   101     @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
   102     @%append $@ NAME $(DLLFILE)
   103     @for %i in ($(OBJS)) do @%append $@ FILE %i
   104     @%append $@ LIBPATH $(%LIB);$(LIBPATH)
   105     @for %i in ($(LIBS)) do @%append $@ LIB %i
   106     @%append $@ OPTION QUIET
   107     @%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
   108     @%append $@ OPTION MAP=$(LIBHOME)/$^&.map
   109     @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
   110     @%append $@ OPTION QUIET
   111     @%append $@ OPTION ELIMINATE
   112     @%append $@ OPTION MANYAUTODATA
   113     @%append $@ OPTION OSNAME='OS/2 and eComStation'
   114     @%append $@ OPTION SHOWDEAD
   115 
   116 clean: .SYMBOLIC
   117     @ echo * Clean: $(LIBNAME)
   118     @if exist *.obj rm *.obj
   119     @if exist *.err rm *.err
   120     @if exist $(LNKFILE) rm $(LNKFILE)
   121 
   122 distclean: .SYMBOLIC clean
   123     @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
   124     @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
   125     @if exist $(LIBFILE) rm $(LIBFILE)
   126     @if exist $(DLLFILE) rm $(DLLFILE)