2019-11-20 10:40:50 -07:00
|
|
|
# Open Watcom makefile to build SDL2.dll for OS/2
|
2018-10-30 11:11:02 -06:00
|
|
|
# wmake -f Makefile.os2
|
2021-11-30 15:20:10 -07:00
|
|
|
#
|
2021-12-08 13:51:56 -07:00
|
|
|
# If you have GNU libiconv installed (iconv2.dll), you
|
|
|
|
# can compile against it by specifying LIBICONV=1, e.g.:
|
2021-11-30 15:20:10 -07:00
|
|
|
# wmake -f Makefile.os2 LIBICONV=1
|
2018-10-14 14:56:56 -06:00
|
|
|
|
2018-10-30 11:11:02 -06:00
|
|
|
LIBNAME = SDL2
|
2022-01-07 19:28:25 -07:00
|
|
|
VERSION = 2.0.20
|
2018-10-30 11:11:02 -06:00
|
|
|
DESCRIPTION = Simple DirectMedia Layer 2
|
|
|
|
|
2021-11-30 15:20:10 -07:00
|
|
|
LIBICONV=0
|
2021-12-08 13:51:56 -07:00
|
|
|
ICONVLIB=$(LIBICONV_LIB)
|
2021-11-30 15:20:10 -07:00
|
|
|
|
2018-10-30 11:11:02 -06:00
|
|
|
LIBHOME = .
|
|
|
|
DLLFILE = $(LIBHOME)/$(LIBNAME).dll
|
|
|
|
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
|
|
|
|
LNKFILE = $(LIBNAME).lnk
|
2018-10-14 14:56:56 -06:00
|
|
|
|
|
|
|
INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
|
|
|
|
INCPATH+= -Iinclude
|
|
|
|
|
2021-12-08 11:15:24 -07:00
|
|
|
LIBM = SDL2libm.lib
|
2021-11-30 15:20:02 -07:00
|
|
|
LIBS = mmpm2.lib $(LIBM)
|
2018-10-14 14:56:56 -06:00
|
|
|
CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
|
|
|
|
# max warnings:
|
|
|
|
CFLAGS+= -wx
|
2020-12-07 14:11:10 -07:00
|
|
|
# newer OpenWatcom versions enable W303 by default
|
|
|
|
CFLAGS+= -wcd=303
|
2018-10-14 14:56:56 -06:00
|
|
|
# building dll:
|
|
|
|
CFLAGS+= -bd
|
2021-11-30 15:20:02 -07:00
|
|
|
# iconv:
|
2021-12-08 13:51:56 -07:00
|
|
|
LIBICONV_LIB=iconv2.lib
|
2021-11-30 15:20:10 -07:00
|
|
|
!ifeq LIBICONV 1
|
|
|
|
CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
|
2021-12-08 11:15:24 -07:00
|
|
|
LIBS+= $(ICONVLIB)
|
2021-11-30 15:20:10 -07:00
|
|
|
!else
|
2021-11-30 15:20:02 -07:00
|
|
|
LIBS+= libuls.lib libconv.lib
|
2021-11-30 15:20:10 -07:00
|
|
|
!endif
|
2018-10-14 14:56:56 -06:00
|
|
|
# the include paths :
|
|
|
|
CFLAGS+= $(INCPATH)
|
2018-11-20 00:55:00 -07:00
|
|
|
# building SDL itself (for DECLSPEC):
|
2018-10-14 14:56:56 -06:00
|
|
|
CFLAGS+= -DBUILD_SDL
|
|
|
|
|
2020-10-14 14:01:06 -06:00
|
|
|
# Debug options:
|
|
|
|
# - debug messages from OS/2 related code to stdout:
|
|
|
|
#CFLAGS+= -DOS2DEBUG
|
|
|
|
# - debug messages from OS/2 code via SDL_LogDebug():
|
|
|
|
#CFLAGS+= -DOS2DEBUG=2
|
|
|
|
|
2018-11-18 01:50:02 -07:00
|
|
|
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
|
|
|
|
|
2018-10-14 14:56:56 -06:00
|
|
|
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
|
2020-11-16 16:39:56 -07:00
|
|
|
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
|
2018-10-14 14:56:56 -06:00
|
|
|
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
|
|
|
|
SRCS+= SDL_rwops.c SDL_power.c
|
|
|
|
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
|
|
|
|
SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
|
|
|
|
SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
|
|
|
|
SDL_sensor.c SDL_touch.c
|
2021-11-07 23:58:44 -07:00
|
|
|
SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c
|
2018-10-14 14:56:56 -06:00
|
|
|
SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
|
|
|
|
SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
|
2021-03-16 08:47:51 -06:00
|
|
|
SDL_render_sw.c SDL_rotate.c SDL_triangle.c
|
2018-10-14 14:56:56 -06:00
|
|
|
SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
|
|
|
|
SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
|
|
|
|
SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
|
|
|
|
SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
|
|
|
|
|
|
|
|
SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
|
|
|
|
SRCS+= SDL_systimer.c
|
|
|
|
SRCS+= SDL_sysloadso.c
|
|
|
|
SRCS+= SDL_sysfilesystem.c
|
2021-11-08 07:00:28 -07:00
|
|
|
SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
|
2021-07-07 14:51:32 -06:00
|
|
|
SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c
|
2018-10-14 14:56:56 -06:00
|
|
|
SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
|
|
|
|
SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
|
|
|
|
SRCS+= SDL_dummysensor.c
|
2020-05-04 00:27:29 -06:00
|
|
|
SRCS+= SDL_locale.c SDL_syslocale.c
|
2020-10-05 12:08:45 -06:00
|
|
|
SRCS+= SDL_url.c SDL_sysurl.c
|
2020-05-04 00:27:29 -06:00
|
|
|
|
2021-11-30 15:20:02 -07:00
|
|
|
SRCS+= SDL_os2.c
|
2021-11-30 15:20:10 -07:00
|
|
|
!ifeq LIBICONV 0
|
2021-11-30 15:20:02 -07:00
|
|
|
SRCS+= geniconv.c os2cp.c os2iconv.c sys2utf8.c
|
2021-11-30 15:20:10 -07:00
|
|
|
!endif
|
2020-10-14 14:01:06 -06:00
|
|
|
SRCS+= SDL_os2audio.c
|
|
|
|
SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
|
|
|
|
SDL_os2mouse.c SDL_os2messagebox.c
|
|
|
|
|
2020-10-09 18:00:04 -06:00
|
|
|
SRCS+= SDL_dynapi.c
|
|
|
|
|
2018-10-14 14:56:56 -06:00
|
|
|
OBJS = $(SRCS:.c=.obj)
|
2018-11-18 01:50:02 -07:00
|
|
|
MOBJS= $(MSRCS:.c=.obj)
|
2018-10-14 14:56:56 -06:00
|
|
|
|
2018-10-15 02:01:00 -06:00
|
|
|
.extensions:
|
|
|
|
.extensions: .lib .dll .obj .c .asm
|
|
|
|
|
2021-11-08 07:00:28 -07:00
|
|
|
.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;
|
2020-10-15 17:50:10 -06:00
|
|
|
.c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
|
2021-11-30 15:20:02 -07:00
|
|
|
.c: ./src/core/os2;./src/audio/os2;./src/loadso/os2;./src/filesystem/os2;./src/joystick/os2;./src/thread/os2;./src/timer/os2;./src/video/os2;
|
|
|
|
.c: ./src/core/os2/geniconv;
|
2021-05-14 15:50:20 -06:00
|
|
|
.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi
|
2018-10-15 02:01:00 -06:00
|
|
|
|
2018-10-14 14:56:56 -06:00
|
|
|
all: $(DLLFILE) $(LIBFILE) .symbolic
|
|
|
|
|
2021-12-08 13:51:56 -07:00
|
|
|
$(DLLFILE): $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE)
|
2018-10-30 11:11:02 -06:00
|
|
|
@echo * Linking: $@
|
2018-10-14 14:56:56 -06:00
|
|
|
wlink @$(LNKFILE)
|
|
|
|
|
2018-10-30 11:11:02 -06:00
|
|
|
$(LIBFILE): $(DLLFILE)
|
|
|
|
@echo * Creating LIB file: $@
|
2018-10-14 14:56:56 -06:00
|
|
|
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
|
|
|
|
|
|
|
|
.c.obj:
|
|
|
|
wcc386 $(CFLAGS) -fo=$^@ $<
|
|
|
|
|
2020-10-14 14:01:06 -06:00
|
|
|
SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
|
|
|
|
wcc386 $(CFLAGS) -fo=$^@ $<
|
|
|
|
|
2018-10-14 14:56:56 -06:00
|
|
|
SDL_cpuinfo.obj: SDL_cpuinfo.c
|
|
|
|
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
|
|
|
|
|
2019-08-04 05:56:02 -06:00
|
|
|
SDL_wave.obj: SDL_wave.c
|
|
|
|
wcc386 $(CFLAGS) -wcd=124 -fo=$^@ $<
|
|
|
|
|
2018-10-14 14:56:56 -06:00
|
|
|
SDL_blendfillrect.obj: SDL_blendfillrect.c
|
|
|
|
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
|
|
|
|
|
|
|
|
SDL_blendline.obj: SDL_blendline.c
|
|
|
|
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
|
|
|
|
|
|
|
|
SDL_blendpoint.obj: SDL_blendpoint.c
|
|
|
|
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
|
|
|
|
|
|
|
|
SDL_RLEaccel.obj: SDL_RLEaccel.c
|
|
|
|
wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
|
|
|
|
|
2021-05-14 15:50:20 -06:00
|
|
|
# c99 mode needed because of structs with flexible array members in libusb.h
|
|
|
|
SDL_hidapi.obj: SDL_hidapi.c
|
2021-10-03 15:32:56 -06:00
|
|
|
wcc386 $(CFLAGS) -za99 -fo=$^@ $<
|
2021-05-14 15:50:20 -06:00
|
|
|
|
2018-11-18 01:50:02 -07:00
|
|
|
.c: ./src/libm;
|
|
|
|
$(LIBM): $(MOBJS)
|
|
|
|
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
|
|
|
|
|
2021-12-08 13:51:56 -07:00
|
|
|
$(LIBICONV_LIB): "src/core/os2/iconv2.lbc"
|
|
|
|
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$<
|
|
|
|
|
2018-10-14 14:56:56 -06:00
|
|
|
$(LNKFILE):
|
2018-10-30 11:11:02 -06:00
|
|
|
@echo * Creating linker file: $@
|
2018-10-14 14:56:56 -06:00
|
|
|
@%create $@
|
|
|
|
@%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
|
|
|
|
@%append $@ NAME $(DLLFILE)
|
|
|
|
@for %i in ($(OBJS)) do @%append $@ FILE %i
|
2018-10-30 11:11:02 -06:00
|
|
|
@for %i in ($(LIBS)) do @%append $@ LIB %i
|
2018-10-14 14:56:56 -06:00
|
|
|
@%append $@ OPTION QUIET
|
2018-10-30 11:11:02 -06:00
|
|
|
@%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
|
|
|
|
@%append $@ OPTION MAP=$(LIBHOME)/$^&.map
|
|
|
|
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
|
2018-10-14 14:56:56 -06:00
|
|
|
@%append $@ OPTION ELIMINATE
|
|
|
|
@%append $@ OPTION MANYAUTODATA
|
|
|
|
@%append $@ OPTION OSNAME='OS/2 and eComStation'
|
|
|
|
@%append $@ OPTION SHOWDEAD
|
|
|
|
|
|
|
|
clean: .SYMBOLIC
|
|
|
|
@ echo * Clean: $(LIBNAME)
|
|
|
|
@if exist *.obj rm *.obj
|
|
|
|
@if exist *.err rm *.err
|
|
|
|
@if exist $(LNKFILE) rm $(LNKFILE)
|
2018-11-18 01:50:02 -07:00
|
|
|
@if exist $(LIBM) rm $(LIBM)
|
2021-12-08 13:51:56 -07:00
|
|
|
@if exist $(LIBICONV_LIB) rm $(LIBICONV_LIB)
|
2018-10-14 14:56:56 -06:00
|
|
|
|
|
|
|
distclean: .SYMBOLIC clean
|
2018-10-30 11:11:02 -06:00
|
|
|
@if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
|
|
|
|
@if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
|
|
|
|
@if exist $(LIBFILE) rm $(LIBFILE)
|
2018-10-14 14:56:56 -06:00
|
|
|
@if exist $(DLLFILE) rm $(DLLFILE)
|