🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

284 lines
9.9 KiB

  1. # Open Watcom makefile to build SDL2.dll for OS/2
  2. # wmake -f Makefile.os2
  3. #
  4. # If you have GNU libiconv installed (iconv2.dll), you
  5. # can compile against it by specifying LIBICONV=1, e.g.:
  6. # wmake -f Makefile.os2 LIBICONV=1
  7. #
  8. # If you have libusb-1.0 installed (usb100.dll, libusb.h), you
  9. # can compile hidapi joystick support against it (experimental)
  10. # by specifying HIDAPI=1, e.g.:
  11. # wmake -f Makefile.os2 HIDAPI=1
  12. LIBNAME = SDL2
  13. VERSION = 2.0.22
  14. DESCRIPTION = Simple DirectMedia Layer 2
  15. LIBICONV=0
  16. ICONVLIB=$(LIBICONV_LIB)
  17. LIBHOME = .
  18. DLLFILE = $(LIBHOME)/$(LIBNAME).dll
  19. LIBFILE = $(LIBHOME)/$(LIBNAME).lib
  20. LNKFILE = $(LIBNAME).lnk
  21. INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
  22. INCPATH+= -Iinclude
  23. LIBM = SDL2libm.lib
  24. TLIB = SDL2test.lib
  25. LIBS = mmpm2.lib $(LIBM)
  26. CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei
  27. # Debug options:
  28. # - debug messages from OS/2 related code to stdout:
  29. #CFLAGS+= -DOS2DEBUG
  30. # - debug messages from OS/2 code via SDL_LogDebug():
  31. #CFLAGS+= -DOS2DEBUG=2
  32. # max warnings:
  33. CFLAGS+= -wx
  34. # newer OpenWatcom versions enable W303 by default
  35. CFLAGS+= -wcd=303
  36. # the include paths :
  37. CFLAGS+= $(INCPATH)
  38. CFLAGS_STATIC=$(CFLAGS)
  39. # building dll:
  40. CFLAGS_DLL =$(CFLAGS)
  41. CFLAGS_DLL+= -bd
  42. # iconv:
  43. LIBICONV_LIB=iconv2.lib
  44. !ifeq LIBICONV 1
  45. CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
  46. LIBS+= $(ICONVLIB)
  47. !else
  48. LIBS+= libuls.lib libconv.lib
  49. !endif
  50. # hidapi (libusb):
  51. !ifeq HIDAPI 1
  52. CFLAGS_DLL+= -DHAVE_LIBUSB_H=1
  53. !endif
  54. # building SDL itself (for DECLSPEC):
  55. CFLAGS_DLL+= -DBUILD_SDL
  56. SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c
  57. 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
  58. SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
  59. SRCS+= SDL_rwops.c SDL_power.c
  60. SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
  61. SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
  62. SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
  63. SDL_sensor.c SDL_touch.c
  64. SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c
  65. SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
  66. SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
  67. SDL_render_sw.c SDL_rotate.c SDL_triangle.c
  68. SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
  69. SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
  70. SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
  71. SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
  72. SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
  73. SRCS+= SDL_systimer.c
  74. SRCS+= SDL_sysloadso.c
  75. SRCS+= SDL_sysfilesystem.c
  76. SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
  77. 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
  78. SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
  79. SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
  80. SRCS+= SDL_dummysensor.c
  81. SRCS+= SDL_locale.c SDL_syslocale.c
  82. SRCS+= SDL_url.c SDL_sysurl.c
  83. SRCS+= SDL_os2.c
  84. !ifeq LIBICONV 0
  85. SRCS+= geniconv.c os2cp.c os2iconv.c sys2utf8.c
  86. !endif
  87. SRCS+= SDL_os2audio.c
  88. SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
  89. SDL_os2mouse.c SDL_os2messagebox.c
  90. SRCS+= SDL_dynapi.c
  91. OBJS = $(SRCS:.c=.obj)
  92. .extensions:
  93. .extensions: .lib .dll .obj .c .asm
  94. .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;
  95. .c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
  96. .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;
  97. .c: ./src/core/os2/geniconv;
  98. .c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi
  99. all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
  100. build_dll: .symbolic
  101. @echo * Compiling dll objects
  102. $(DLLFILE): build_dll $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE)
  103. @echo * Linking: $@
  104. wlink @$(LNKFILE)
  105. $(LIBFILE): $(DLLFILE)
  106. @echo * Creating LIB file: $@
  107. wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
  108. .c.obj:
  109. wcc386 $(CFLAGS_DLL) -fo=$^@ $<
  110. SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
  111. wcc386 $(CFLAGS_DLL) -fo=$^@ $<
  112. SDL_cpuinfo.obj: SDL_cpuinfo.c
  113. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  114. SDL_wave.obj: SDL_wave.c
  115. wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
  116. SDL_blendfillrect.obj: SDL_blendfillrect.c
  117. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  118. SDL_blendline.obj: SDL_blendline.c
  119. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  120. SDL_blendpoint.obj: SDL_blendpoint.c
  121. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  122. SDL_RLEaccel.obj: SDL_RLEaccel.c
  123. wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
  124. !ifeq HIDAPI 1
  125. # c99 mode needed because of structs with flexible array members in libusb.h
  126. SDL_hidapi.obj: SDL_hidapi.c
  127. wcc386 $(CFLAGS_DLL) -za99 -fo=$^@ $<
  128. !endif
  129. $(LIBICONV_LIB): "src/core/os2/iconv2.lbc"
  130. @echo * Creating: $@
  131. wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$<
  132. # SDL2libm
  133. 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 &
  134. k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
  135. s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
  136. MOBJS= $(MSRCS:.c=.obj)
  137. .c: ./src/libm;
  138. e_atan2.obj: e_atan2.c
  139. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  140. e_exp.obj: e_exp.c
  141. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  142. e_fmod.obj: e_fmod.c
  143. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  144. e_log10.obj: e_log10.c
  145. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  146. e_log.obj: e_log.c
  147. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  148. e_pow.obj: e_pow.c
  149. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  150. e_rem_pio2.obj: e_rem_pio2.c
  151. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  152. e_sqrt.obj: e_sqrt.c
  153. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  154. k_cos.obj: k_cos.c
  155. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  156. k_rem_pio2.obj: k_rem_pio2.c
  157. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  158. k_sin.obj: k_sin.c
  159. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  160. k_tan.obj: k_tan.c
  161. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  162. s_atan.obj: s_atan.c
  163. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  164. s_copysign.obj: s_copysign.c
  165. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  166. s_cos.obj: s_cos.c
  167. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  168. s_fabs.obj: s_fabs.c
  169. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  170. s_floor.obj: s_floor.c
  171. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  172. s_scalbn.obj: s_scalbn.c
  173. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  174. s_sin.obj: s_sin.c
  175. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  176. s_tan.obj: s_tan.c
  177. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  178. build_libm: .symbolic
  179. @echo * Compiling libm objects
  180. $(LIBM): build_libm $(MOBJS)
  181. @echo * Creating: $@
  182. wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
  183. # SDL2test
  184. TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
  185. SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
  186. SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
  187. SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
  188. SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
  189. TOBJS= $(TSRCS:.c=.obj)
  190. .c: ./src/test;
  191. SDL_test_assert.obj: SDL_test_assert.c
  192. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  193. SDL_test_common.obj: SDL_test_common.c
  194. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  195. SDL_test_compare.obj: SDL_test_compare.c
  196. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  197. SDL_test_crc32.obj: SDL_test_crc32.c
  198. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  199. SDL_test_font.obj: SDL_test_font.c
  200. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  201. SDL_test_fuzzer.obj: SDL_test_fuzzer.c
  202. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  203. SDL_test_harness.obj: SDL_test_harness.c
  204. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  205. SDL_test_imageBlit.obj: SDL_test_imageBlit.c
  206. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  207. SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
  208. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  209. SDL_test_imageFace.obj: SDL_test_imageFace.c
  210. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  211. SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
  212. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  213. SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
  214. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  215. SDL_test_log.obj: SDL_test_log.c
  216. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  217. SDL_test_md5.obj: SDL_test_md5.c
  218. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  219. SDL_test_random.obj: SDL_test_random.c
  220. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  221. SDL_test_memory.obj: SDL_test_memory.c
  222. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  223. build_tlib: .symbolic
  224. @echo * Compiling testlib objects
  225. $(TLIB): build_tlib $(TOBJS)
  226. @echo * Creating: $@
  227. wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
  228. $(LNKFILE):
  229. @echo * Creating linker file: $@
  230. @%create $@
  231. @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
  232. @%append $@ NAME $(DLLFILE)
  233. @for %i in ($(OBJS)) do @%append $@ FILE %i
  234. @for %i in ($(LIBS)) do @%append $@ LIB %i
  235. @%append $@ OPTION QUIET
  236. @%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
  237. @%append $@ OPTION MAP=$(LIBHOME)/$^&.map
  238. @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
  239. @%append $@ OPTION ELIMINATE
  240. @%append $@ OPTION MANYAUTODATA
  241. @%append $@ OPTION OSNAME='OS/2 and eComStation'
  242. @%append $@ OPTION SHOWDEAD
  243. clean: .SYMBOLIC
  244. @echo * Clean: $(LIBNAME)
  245. @if exist *.obj rm *.obj
  246. @if exist *.err rm *.err
  247. @if exist $(LNKFILE) rm $(LNKFILE)
  248. @if exist $(LIBM) rm $(LIBM)
  249. @if exist $(LIBICONV_LIB) rm $(LIBICONV_LIB)
  250. distclean: .SYMBOLIC clean
  251. @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
  252. @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
  253. @if exist $(LIBFILE) rm $(LIBFILE)
  254. @if exist $(DLLFILE) rm $(DLLFILE)
  255. @if exist $(TLIB) rm $(TLIB)