yuzu-early/externals/SDL/Makefile.os2

283 lines
9.9 KiB
Makefile
Raw Normal View History

2021-04-18 05:35:25 +02:00
# Open Watcom makefile to build SDL2.dll for OS/2
# wmake -f Makefile.os2
2021-12-18 11:14:57 +01:00
#
# If you have GNU libiconv installed (iconv2.dll), you
# can compile against it by specifying LIBICONV=1, e.g.:
# wmake -f Makefile.os2 LIBICONV=1
2022-07-15 04:00:50 +02:00
#
# If you have libusb-1.0 installed (usb100.dll, libusb.h), you
# can compile hidapi joystick support against it (experimental)
# by specifying HIDAPI=1, e.g.:
# wmake -f Makefile.os2 HIDAPI=1
2021-04-18 05:35:25 +02:00
LIBNAME = SDL2
2022-07-19 05:48:31 +02:00
VERSION = 2.0.20
2021-04-18 05:35:25 +02:00
DESCRIPTION = Simple DirectMedia Layer 2
2021-12-18 11:14:57 +01:00
LIBICONV=0
ICONVLIB=$(LIBICONV_LIB)
2021-04-18 05:35:25 +02:00
LIBHOME = .
DLLFILE = $(LIBHOME)/$(LIBNAME).dll
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
LNKFILE = $(LIBNAME).lnk
INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
INCPATH+= -Iinclude
2021-12-18 11:14:57 +01:00
LIBM = SDL2libm.lib
2022-07-15 04:00:50 +02:00
TLIB = SDL2test.lib
2021-12-18 11:14:57 +01:00
LIBS = mmpm2.lib $(LIBM)
2022-07-19 05:48:31 +02:00
CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
2021-04-18 05:35:25 +02:00
# max warnings:
CFLAGS+= -wx
2021-04-20 21:40:33 +02:00
# newer OpenWatcom versions enable W303 by default
CFLAGS+= -wcd=303
2022-07-15 04:00:50 +02:00
# the include paths :
CFLAGS+= $(INCPATH)
CFLAGS_STATIC=$(CFLAGS)
2021-04-18 05:35:25 +02:00
# building dll:
2022-07-15 04:00:50 +02:00
CFLAGS_DLL =$(CFLAGS)
CFLAGS_DLL+= -bd
2021-12-18 11:14:57 +01:00
# iconv:
LIBICONV_LIB=iconv2.lib
!ifeq LIBICONV 1
2022-07-15 04:00:50 +02:00
CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
2021-12-18 11:14:57 +01:00
LIBS+= $(ICONVLIB)
!else
LIBS+= libuls.lib libconv.lib
!endif
2022-07-15 04:00:50 +02:00
# hidapi (libusb):
!ifeq HIDAPI 1
CFLAGS_DLL+= -DHAVE_LIBUSB_H=1
!endif
2021-04-18 05:35:25 +02:00
# building SDL itself (for DECLSPEC):
2022-07-15 04:00:50 +02:00
CFLAGS_DLL+= -DBUILD_SDL
2021-04-20 21:40:33 +02:00
2022-07-19 05:48:31 +02: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
2021-04-18 05:35:25 +02:00
2022-07-19 05:48:31 +02:00
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 SDL_strtokr.c SDL_crc32.c
2021-04-18 05:35:25 +02: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
2022-07-19 05:48:31 +02:00
SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c
2021-04-18 05:35:25 +02: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-12-07 02:20:09 +01:00
SDL_render_sw.c SDL_rotate.c SDL_triangle.c
2021-04-18 05:35:25 +02: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-12-07 02:20:09 +01:00
SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
2021-08-12 01:07:27 +02: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
2021-04-18 05:35:25 +02:00
SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
SRCS+= SDL_dummysensor.c
2021-04-20 21:40:33 +02:00
SRCS+= SDL_locale.c SDL_syslocale.c
SRCS+= SDL_url.c SDL_sysurl.c
2021-12-18 11:14:57 +01:00
SRCS+= SDL_os2.c
!ifeq LIBICONV 0
SRCS+= geniconv.c os2cp.c os2iconv.c sys2utf8.c
!endif
2021-04-20 21:40:33 +02:00
SRCS+= SDL_os2audio.c
SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
SDL_os2mouse.c SDL_os2messagebox.c
2021-04-18 05:35:25 +02:00
SRCS+= SDL_dynapi.c
OBJS = $(SRCS:.c=.obj)
.extensions:
.extensions: .lib .dll .obj .c .asm
.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;
2021-04-20 21:40:33 +02:00
.c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
2021-12-18 11:14:57 +01: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-06-11 20:56:03 +02:00
.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi
2021-04-18 05:35:25 +02:00
2022-07-15 04:00:50 +02:00
all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
build_dll: .symbolic
@echo * Compiling dll objects
2021-04-18 05:35:25 +02:00
2022-07-15 04:00:50 +02:00
$(DLLFILE): build_dll $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE)
2021-04-18 05:35:25 +02:00
@echo * Linking: $@
wlink @$(LNKFILE)
$(LIBFILE): $(DLLFILE)
@echo * Creating LIB file: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
.c.obj:
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
2021-04-18 05:35:25 +02:00
2021-04-20 21:40:33 +02:00
SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
2021-04-18 05:35:25 +02:00
SDL_cpuinfo.obj: SDL_cpuinfo.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
2021-04-18 05:35:25 +02:00
SDL_wave.obj: SDL_wave.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
2021-04-18 05:35:25 +02:00
SDL_blendfillrect.obj: SDL_blendfillrect.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
2021-04-18 05:35:25 +02:00
SDL_blendline.obj: SDL_blendline.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
2021-04-18 05:35:25 +02:00
SDL_blendpoint.obj: SDL_blendpoint.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
2021-04-18 05:35:25 +02:00
SDL_RLEaccel.obj: SDL_RLEaccel.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
2021-06-11 20:56:03 +02:00
# c99 mode needed because of structs with flexible array members in libusb.h
SDL_hidapi.obj: SDL_hidapi.c
2022-07-15 04:00:50 +02:00
wcc386 $(CFLAGS_DLL) -za99 -fo=$^@ $<
$(LIBICONV_LIB): "src/core/os2/iconv2.lbc"
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$<
# SDL2libm
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
MOBJS= $(MSRCS:.c=.obj)
2021-06-11 20:56:03 +02:00
2021-04-18 05:35:25 +02:00
.c: ./src/libm;
2022-07-15 04:00:50 +02:00
e_atan2.obj: e_atan2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_exp.obj: e_exp.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_fmod.obj: e_fmod.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log10.obj: e_log10.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log.obj: e_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_pow.obj: e_pow.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_rem_pio2.obj: e_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_sqrt.obj: e_sqrt.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_cos.obj: k_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_rem_pio2.obj: k_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_sin.obj: k_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_tan.obj: k_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_atan.obj: s_atan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_copysign.obj: s_copysign.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_cos.obj: s_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_fabs.obj: s_fabs.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_floor.obj: s_floor.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_scalbn.obj: s_scalbn.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_sin.obj: s_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_tan.obj: s_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_libm: .symbolic
@echo * Compiling libm objects
$(LIBM): build_libm $(MOBJS)
@echo * Creating: $@
2021-04-18 05:35:25 +02:00
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
2022-07-15 04:00:50 +02:00
# SDL2test
TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
TOBJS= $(TSRCS:.c=.obj)
.c: ./src/test;
SDL_test_assert.obj: SDL_test_assert.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_common.obj: SDL_test_common.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_compare.obj: SDL_test_compare.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_crc32.obj: SDL_test_crc32.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_font.obj: SDL_test_font.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_fuzzer.obj: SDL_test_fuzzer.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_harness.obj: SDL_test_harness.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlit.obj: SDL_test_imageBlit.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageFace.obj: SDL_test_imageFace.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_log.obj: SDL_test_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_md5.obj: SDL_test_md5.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_random.obj: SDL_test_random.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_memory.obj: SDL_test_memory.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_tlib: .symbolic
@echo * Compiling testlib objects
$(TLIB): build_tlib $(TOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
2021-12-18 11:14:57 +01:00
2021-04-18 05:35:25 +02:00
$(LNKFILE):
@echo * Creating linker file: $@
@%create $@
@%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
@%append $@ NAME $(DLLFILE)
@for %i in ($(OBJS)) do @%append $@ FILE %i
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ OPTION QUIET
@%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
@%append $@ OPTION MAP=$(LIBHOME)/$^&.map
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
@%append $@ OPTION ELIMINATE
@%append $@ OPTION MANYAUTODATA
@%append $@ OPTION OSNAME='OS/2 and eComStation'
@%append $@ OPTION SHOWDEAD
clean: .SYMBOLIC
2022-07-15 04:00:50 +02:00
@echo * Clean: $(LIBNAME)
2021-04-18 05:35:25 +02:00
@if exist *.obj rm *.obj
@if exist *.err rm *.err
@if exist $(LNKFILE) rm $(LNKFILE)
@if exist $(LIBM) rm $(LIBM)
2021-12-18 11:14:57 +01:00
@if exist $(LIBICONV_LIB) rm $(LIBICONV_LIB)
2021-04-18 05:35:25 +02:00
distclean: .SYMBOLIC clean
@if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
@if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
@if exist $(LIBFILE) rm $(LIBFILE)
@if exist $(DLLFILE) rm $(DLLFILE)
2022-07-15 04:00:50 +02:00
@if exist $(TLIB) rm $(TLIB)