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

280 lines
11 KiB

  1. # Open Watcom makefile to build SDL2.dll for Win32
  2. # wmake -f Makefile.w32
  3. #
  4. # To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1
  5. LIBNAME = SDL2
  6. MAJOR_VERSION = 2
  7. MINOR_VERSION = 26
  8. MICRO_VERSION = 2
  9. VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
  10. LIBHOME = .
  11. DLLFILE = $(LIBHOME)/$(LIBNAME).dll
  12. LIBFILE = $(LIBHOME)/$(LIBNAME).lib
  13. EXPFILE = $(LIBHOME)/$(LIBNAME).exp
  14. LNKFILE = $(LIBNAME).lnk
  15. INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h/nt/directx" -I"$(%WATCOM)/h"
  16. INCPATH+= -Iinclude
  17. INCPATH+= -I"src/video/khronos"
  18. LIBM = SDL2libm.lib
  19. TLIB = SDL2test.lib
  20. # user32.lib, gdi32.lib, ole32.lib and oleaut32.lib are actually
  21. # among the default libraries in wlink.lnk for nt_dll linkage...
  22. LIBS = user32.lib gdi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib shell32.lib setupapi.lib version.lib uuid.lib dxguid.lib $(LIBM)
  23. CFLAGS = -bt=nt -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei
  24. # max warnings:
  25. CFLAGS+= -wx
  26. !ifeq ENABLE_WERROR 1
  27. CFLAGS+= -we
  28. !endif
  29. # newer OpenWatcom versions enable W303 by default
  30. CFLAGS+= -wcd=303
  31. # new vulkan headers result in lots of W202 warnings
  32. CFLAGS+= -wcd=202
  33. # the include paths :
  34. CFLAGS+= $(INCPATH)
  35. CFLAGS_STATIC=$(CFLAGS)
  36. # building dll:
  37. CFLAGS_DLL =$(CFLAGS)
  38. CFLAGS_DLL+= -bd
  39. # we override the DECLSPEC define in begin_code.h, because we are using
  40. # an exports file to remove the _cdecl '_' prefix from the symbol names
  41. CFLAGS_DLL+= -DDECLSPEC=
  42. CFLAGS_DLL+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION)
  43. CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
  44. CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
  45. RCFLAGS = -q -r -bt=nt $(INCPATH)
  46. 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
  47. 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
  48. SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
  49. SRCS+= SDL_rwops.c SDL_power.c
  50. SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
  51. SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
  52. SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
  53. SDL_sensor.c SDL_touch.c
  54. SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c
  55. SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
  56. SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
  57. SDL_render_sw.c SDL_rotate.c SDL_triangle.c
  58. SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
  59. SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
  60. SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
  61. SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
  62. SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
  63. SRCS+= SDL_systimer.c
  64. SRCS+= SDL_sysloadso.c
  65. SRCS+= SDL_sysfilesystem.c
  66. SRCS+= SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
  67. 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
  68. SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
  69. SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
  70. SRCS+= SDL_dummysensor.c
  71. SRCS+= SDL_locale.c SDL_syslocale.c
  72. SRCS+= SDL_url.c SDL_sysurl.c
  73. SRCS+= SDL_winmm.c SDL_directsound.c SDL_wasapi.c SDL_wasapi_win32.c
  74. SRCS+= SDL_hid.c SDL_immdevice.c SDL_windows.c SDL_xinput.c
  75. SRCS+= SDL_dinputhaptic.c SDL_windowshaptic.c SDL_xinputhaptic.c
  76. SRCS+= SDL_dinputjoystick.c SDL_rawinputjoystick.c SDL_windowsjoystick.c SDL_windows_gaming_input.c SDL_xinputjoystick.c
  77. SRCS+= SDL_syspower.c
  78. SRCS+= SDL_d3dmath.c
  79. SRCS+= SDL_render_d3d.c SDL_shaders_d3d.c
  80. SRCS+= SDL_render_d3d11.c SDL_shaders_d3d11.c
  81. SRCS+= SDL_render_d3d12.c SDL_shaders_d3d12.c
  82. SRCS+= SDL_render_gl.c SDL_shaders_gl.c
  83. SRCS+= SDL_render_gles2.c SDL_shaders_gles2.c
  84. SRCS+= SDL_windowssensor.c
  85. SRCS+= SDL_syscond_cv.c
  86. SRCS+= SDL_windowsclipboard.c SDL_windowsevents.c SDL_windowsframebuffer.c SDL_windowskeyboard.c SDL_windowsmessagebox.c SDL_windowsmodes.c SDL_windowsmouse.c SDL_windowsopengl.c SDL_windowsopengles.c SDL_windowsshape.c SDL_windowsvideo.c SDL_windowsvulkan.c SDL_windowswindow.c
  87. SRCS+= SDL_dynapi.c
  88. RCSRCS = version.rc
  89. OBJS = $(SRCS:.c=.obj)
  90. RCOBJS= $(RCSRCS:.rc=.res)
  91. .extensions:
  92. .extensions: .lib .dll .obj .res .c .rc .asm
  93. .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;
  94. .c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
  95. .c: ./src/core/windows;./src/audio/winmm;./src/audio/directsound;./src/audio/wasapi;./src/loadso/windows;./src/filesystem/windows;./src/haptic/windows;./src/joystick/windows;./src/sensor/windows;./src/thread/windows;./src/timer/windows;./src/video/windows;
  96. .c: ./src/locale/;./src/locale/windows;./src/misc;./src/misc/windows;./src/power/windows;./src/joystick/hidapi;./src/hidapi;./src/render/direct3d;./src/render/direct3d11;./src/render/direct3d12;./src/render/opengl;./src/render/opengles2
  97. .rc: ./src/main/windows
  98. all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
  99. build_dll: .symbolic
  100. @echo * Compiling dll objects
  101. $(DLLFILE): build_dll $(OBJS) $(LIBM) $(RCOBJS) $(LNKFILE)
  102. @echo * Linking: $@
  103. wlink @$(LNKFILE)
  104. $(LIBFILE): $(DLLFILE)
  105. @echo * Creating LIB file: $@
  106. wlib -q -b -n -c -pa -s -t -zld -ii -io $* @$(EXPFILE)
  107. .c.obj:
  108. wcc386 $(CFLAGS_DLL) -fo=$^@ $<
  109. .rc.res:
  110. wrc $(RCFLAGS) -fo=$^@ $<
  111. SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
  112. wcc386 $(CFLAGS_DLL) -fo=$^@ $<
  113. SDL_cpuinfo.obj: SDL_cpuinfo.c
  114. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  115. SDL_wave.obj: SDL_wave.c
  116. wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
  117. SDL_blendfillrect.obj: SDL_blendfillrect.c
  118. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  119. SDL_blendline.obj: SDL_blendline.c
  120. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  121. SDL_blendpoint.obj: SDL_blendpoint.c
  122. wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
  123. SDL_RLEaccel.obj: SDL_RLEaccel.c
  124. wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
  125. SDL_malloc.obj: SDL_malloc.c
  126. wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
  127. # SDL2libm
  128. 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 &
  129. k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
  130. s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
  131. MOBJS= $(MSRCS:.c=.obj)
  132. .c: ./src/libm;
  133. e_atan2.obj: e_atan2.c
  134. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  135. e_exp.obj: e_exp.c
  136. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  137. e_fmod.obj: e_fmod.c
  138. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  139. e_log10.obj: e_log10.c
  140. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  141. e_log.obj: e_log.c
  142. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  143. e_pow.obj: e_pow.c
  144. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  145. e_rem_pio2.obj: e_rem_pio2.c
  146. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  147. e_sqrt.obj: e_sqrt.c
  148. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  149. k_cos.obj: k_cos.c
  150. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  151. k_rem_pio2.obj: k_rem_pio2.c
  152. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  153. k_sin.obj: k_sin.c
  154. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  155. k_tan.obj: k_tan.c
  156. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  157. s_atan.obj: s_atan.c
  158. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  159. s_copysign.obj: s_copysign.c
  160. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  161. s_cos.obj: s_cos.c
  162. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  163. s_fabs.obj: s_fabs.c
  164. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  165. s_floor.obj: s_floor.c
  166. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  167. s_scalbn.obj: s_scalbn.c
  168. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  169. s_sin.obj: s_sin.c
  170. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  171. s_tan.obj: s_tan.c
  172. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  173. build_libm: .symbolic
  174. @echo * Compiling libm objects
  175. $(LIBM): build_libm $(MOBJS)
  176. @echo * Creating: $@
  177. wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
  178. # SDL2test
  179. TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
  180. SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
  181. SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
  182. SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
  183. SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
  184. TOBJS= $(TSRCS:.c=.obj)
  185. .c: ./src/test;
  186. SDL_test_assert.obj: SDL_test_assert.c
  187. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  188. SDL_test_common.obj: SDL_test_common.c
  189. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  190. SDL_test_compare.obj: SDL_test_compare.c
  191. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  192. SDL_test_crc32.obj: SDL_test_crc32.c
  193. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  194. SDL_test_font.obj: SDL_test_font.c
  195. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  196. SDL_test_fuzzer.obj: SDL_test_fuzzer.c
  197. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  198. SDL_test_harness.obj: SDL_test_harness.c
  199. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  200. SDL_test_imageBlit.obj: SDL_test_imageBlit.c
  201. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  202. SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
  203. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  204. SDL_test_imageFace.obj: SDL_test_imageFace.c
  205. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  206. SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
  207. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  208. SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
  209. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  210. SDL_test_log.obj: SDL_test_log.c
  211. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  212. SDL_test_md5.obj: SDL_test_md5.c
  213. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  214. SDL_test_random.obj: SDL_test_random.c
  215. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  216. SDL_test_memory.obj: SDL_test_memory.c
  217. wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
  218. build_tlib: .symbolic
  219. @echo * Compiling testlib objects
  220. $(TLIB): build_tlib $(TOBJS)
  221. @echo * Creating: $@
  222. wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
  223. $(LNKFILE): Makefile.w32
  224. @echo * Creating linker file: $@
  225. @%create $@
  226. @%append $@ SYSTEM nt_dll INITINSTANCE TERMINSTANCE
  227. @%append $@ NAME $(DLLFILE)
  228. @for %i in ($(OBJS)) do @%append $@ FILE %i
  229. @for %i in ($(LIBS)) do @%append $@ LIB %i
  230. @%append $@ OPTION RESOURCE=$(RCOBJS)
  231. @%append $@ EXPORT=src/dynapi/SDL2.exports
  232. @%append $@ OPTION QUIET
  233. @%append $@ OPTION IMPF=$(EXPFILE)
  234. @%append $@ OPTION MAP=$(LIBHOME)/$^&.map
  235. @%append $@ OPTION ELIMINATE
  236. @%append $@ OPTION SHOWDEAD
  237. clean: .SYMBOLIC
  238. @echo * Clean: $(LIBNAME)
  239. @if exist *.obj rm *.obj
  240. @if exist *.res rm *.res
  241. @if exist *.err rm *.err
  242. @if exist $(LNKFILE) rm $(LNKFILE)
  243. @if exist $(LIBM) rm $(LIBM)
  244. distclean: .SYMBOLIC clean
  245. @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
  246. @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
  247. @if exist $(LIBFILE) rm $(LIBFILE)
  248. @if exist $(DLLFILE) rm $(DLLFILE)
  249. @if exist $(TLIB) rm $(TLIB)