🛠️🐜 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.

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