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

453 lines
11 KiB

  1. # Makefile to build the SDL tests
  2. srcdir = @srcdir@
  3. prefix = @prefix@
  4. exec_prefix = @exec_prefix@
  5. bindir = @bindir@
  6. libdir = @libdir@
  7. libexecdir = @libexecdir@
  8. includedir = @includedir@
  9. datarootdir = @datarootdir@
  10. datadir = @datadir@
  11. CC = @CC@
  12. EXE = @EXE@
  13. CFLAGS = @CFLAGS@ -g
  14. LIBS = @LIBS@
  15. TARGETS = \
  16. checkkeys$(EXE) \
  17. checkkeysthreads$(EXE) \
  18. controllermap$(EXE) \
  19. loopwave$(EXE) \
  20. loopwavequeue$(EXE) \
  21. testatomic$(EXE) \
  22. testaudiocapture$(EXE) \
  23. testaudiohotplug$(EXE) \
  24. testaudioinfo$(EXE) \
  25. testautomation$(EXE) \
  26. testbounds$(EXE) \
  27. testcustomcursor$(EXE) \
  28. testdisplayinfo$(EXE) \
  29. testdraw2$(EXE) \
  30. testdrawchessboard$(EXE) \
  31. testdropfile$(EXE) \
  32. testerror$(EXE) \
  33. testevdev$(EXE) \
  34. testfile$(EXE) \
  35. testfilesystem$(EXE) \
  36. testgamecontroller$(EXE) \
  37. testgeometry$(EXE) \
  38. testgesture$(EXE) \
  39. testhaptic$(EXE) \
  40. testhittesting$(EXE) \
  41. testhotplug$(EXE) \
  42. testiconv$(EXE) \
  43. testime$(EXE) \
  44. testintersections$(EXE) \
  45. testjoystick$(EXE) \
  46. testkeys$(EXE) \
  47. testloadso$(EXE) \
  48. testlocale$(EXE) \
  49. testlock$(EXE) \
  50. testmessage$(EXE) \
  51. testmouse$(EXE) \
  52. testmultiaudio$(EXE) \
  53. testnative$(EXE) \
  54. testoverlay2$(EXE) \
  55. testplatform$(EXE) \
  56. testpower$(EXE) \
  57. testqsort$(EXE) \
  58. testrelative$(EXE) \
  59. testrendercopyex$(EXE) \
  60. testrendertarget$(EXE) \
  61. testresample$(EXE) \
  62. testrumble$(EXE) \
  63. testscale$(EXE) \
  64. testsem$(EXE) \
  65. testsensor$(EXE) \
  66. testshape$(EXE) \
  67. testsprite2$(EXE) \
  68. testspriteminimal$(EXE) \
  69. teststreaming$(EXE) \
  70. testsurround$(EXE) \
  71. testthread$(EXE) \
  72. testtimer$(EXE) \
  73. testurl$(EXE) \
  74. testver$(EXE) \
  75. testviewport$(EXE) \
  76. testvulkan$(EXE) \
  77. testwm2$(EXE) \
  78. testyuv$(EXE) \
  79. torturethread$(EXE) \
  80. @OPENGL_TARGETS@ += testgl2$(EXE) testshader$(EXE)
  81. @OPENGLES1_TARGETS@ += testgles$(EXE)
  82. @OPENGLES2_TARGETS@ += testgles2$(EXE)
  83. all: Makefile $(TARGETS) copydatafiles generatetestmeta
  84. installedtestsdir = $(libexecdir)/installed-tests/SDL2
  85. installedtestsmetadir = $(datadir)/installed-tests/SDL2
  86. generatetestmeta:
  87. rm -f *.test
  88. set -e; for exe in $(noninteractive) $(needs_audio) $(needs_display); do \
  89. sed \
  90. -e 's#@installedtestsdir@#$(installedtestsdir)#g' \
  91. -e "s#@exe@#$$exe#g" \
  92. < $(srcdir)/template.test.in > $$exe.test; \
  93. done
  94. install: all
  95. install -d $(DESTDIR)$(installedtestsdir)
  96. install $(TARGETS) $(DESTDIR)$(installedtestsdir)
  97. install -m644 $(DATA) $(DESTDIR)$(installedtestsdir)
  98. install -d $(DESTDIR)$(installedtestsmetadir)
  99. install -m644 *.test $(DESTDIR)$(installedtestsmetadir)
  100. Makefile: $(srcdir)/Makefile.in
  101. $(SHELL) config.status $@
  102. checkkeys$(EXE): $(srcdir)/checkkeys.c
  103. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  104. checkkeysthreads$(EXE): $(srcdir)/checkkeysthreads.c
  105. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  106. loopwave$(EXE): $(srcdir)/loopwave.c $(srcdir)/testutils.c
  107. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  108. loopwavequeue$(EXE): $(srcdir)/loopwavequeue.c $(srcdir)/testutils.c
  109. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  110. testsurround$(EXE): $(srcdir)/testsurround.c
  111. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  112. testresample$(EXE): $(srcdir)/testresample.c
  113. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  114. testaudioinfo$(EXE): $(srcdir)/testaudioinfo.c
  115. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  116. testautomation$(EXE): $(srcdir)/testautomation.c \
  117. $(srcdir)/testautomation_audio.c \
  118. $(srcdir)/testautomation_clipboard.c \
  119. $(srcdir)/testautomation_events.c \
  120. $(srcdir)/testautomation_guid.c \
  121. $(srcdir)/testautomation_hints.c \
  122. $(srcdir)/testautomation_joystick.c \
  123. $(srcdir)/testautomation_keyboard.c \
  124. $(srcdir)/testautomation_main.c \
  125. $(srcdir)/testautomation_math.c \
  126. $(srcdir)/testautomation_mouse.c \
  127. $(srcdir)/testautomation_pixels.c \
  128. $(srcdir)/testautomation_platform.c \
  129. $(srcdir)/testautomation_rect.c \
  130. $(srcdir)/testautomation_render.c \
  131. $(srcdir)/testautomation_rwops.c \
  132. $(srcdir)/testautomation_sdltest.c \
  133. $(srcdir)/testautomation_stdlib.c \
  134. $(srcdir)/testautomation_surface.c \
  135. $(srcdir)/testautomation_syswm.c \
  136. $(srcdir)/testautomation_timer.c \
  137. $(srcdir)/testautomation_video.c
  138. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  139. testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c $(srcdir)/testutils.c
  140. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  141. testaudiohotplug$(EXE): $(srcdir)/testaudiohotplug.c $(srcdir)/testutils.c
  142. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  143. testaudiocapture$(EXE): $(srcdir)/testaudiocapture.c
  144. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  145. testatomic$(EXE): $(srcdir)/testatomic.c
  146. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  147. testintersections$(EXE): $(srcdir)/testintersections.c
  148. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  149. testrelative$(EXE): $(srcdir)/testrelative.c
  150. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  151. testhittesting$(EXE): $(srcdir)/testhittesting.c
  152. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  153. testdraw2$(EXE): $(srcdir)/testdraw2.c
  154. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  155. testdrawchessboard$(EXE): $(srcdir)/testdrawchessboard.c
  156. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  157. testdropfile$(EXE): $(srcdir)/testdropfile.c
  158. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  159. testerror$(EXE): $(srcdir)/testerror.c
  160. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  161. testevdev$(EXE): $(srcdir)/testevdev.c
  162. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  163. testfile$(EXE): $(srcdir)/testfile.c
  164. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  165. testgamecontroller$(EXE): $(srcdir)/testgamecontroller.c $(srcdir)/testutils.c
  166. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  167. testgeometry$(EXE): $(srcdir)/testgeometry.c $(srcdir)/testutils.c
  168. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  169. testgesture$(EXE): $(srcdir)/testgesture.c
  170. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  171. testgl2$(EXE): $(srcdir)/testgl2.c
  172. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  173. testgles$(EXE): $(srcdir)/testgles.c
  174. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLESLIB@ @MATHLIB@
  175. testgles2$(EXE): $(srcdir)/testgles2.c
  176. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  177. testgles2_sdf$(EXE): $(srcdir)/testgles2_sdf.c $(srcdir)/testutils.c
  178. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  179. testhaptic$(EXE): $(srcdir)/testhaptic.c
  180. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  181. testhotplug$(EXE): $(srcdir)/testhotplug.c
  182. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  183. testrumble$(EXE): $(srcdir)/testrumble.c
  184. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  185. testthread$(EXE): $(srcdir)/testthread.c
  186. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  187. testiconv$(EXE): $(srcdir)/testiconv.c $(srcdir)/testutils.c
  188. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  189. testime$(EXE): $(srcdir)/testime.c $(srcdir)/testutils.c
  190. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @SDL_TTF_LIB@
  191. testjoystick$(EXE): $(srcdir)/testjoystick.c
  192. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  193. testkeys$(EXE): $(srcdir)/testkeys.c
  194. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  195. testloadso$(EXE): $(srcdir)/testloadso.c
  196. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  197. testlock$(EXE): $(srcdir)/testlock.c
  198. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  199. ifeq (@ISMACOSX@,true)
  200. testnative$(EXE): $(srcdir)/testnative.c \
  201. $(srcdir)/testnativecocoa.m \
  202. $(srcdir)/testutils.c \
  203. $(srcdir)/testnativex11.c
  204. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) -framework Cocoa @XLIB@
  205. endif
  206. ifeq (@ISWINDOWS@,true)
  207. testnative$(EXE): $(srcdir)/testnative.c \
  208. $(srcdir)/testutils.c \
  209. $(srcdir)/testnativew32.c
  210. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  211. endif
  212. ifeq (@ISUNIX@,true)
  213. testnative$(EXE): $(srcdir)/testnative.c \
  214. $(srcdir)/testutils.c \
  215. $(srcdir)/testnativex11.c
  216. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @XLIB@
  217. endif
  218. ifeq (@ISOS2@,true)
  219. testnative$(EXE): $(srcdir)/testnative.c \
  220. $(srcdir)/testnativeos2.c
  221. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  222. endif
  223. #there's probably a better way of doing this
  224. ifeq (@ISMACOSX@,false)
  225. ifeq (@ISWINDOWS@,false)
  226. ifeq (@ISUNIX@,false)
  227. ifeq (@ISOS2@,false)
  228. testnative$(EXE): ;
  229. endif
  230. endif
  231. endif
  232. endif
  233. testoverlay2$(EXE): $(srcdir)/testoverlay2.c $(srcdir)/testyuv_cvt.c $(srcdir)/testutils.c
  234. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  235. testplatform$(EXE): $(srcdir)/testplatform.c
  236. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  237. testpower$(EXE): $(srcdir)/testpower.c
  238. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  239. testfilesystem$(EXE): $(srcdir)/testfilesystem.c
  240. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  241. testrendertarget$(EXE): $(srcdir)/testrendertarget.c $(srcdir)/testutils.c
  242. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  243. testscale$(EXE): $(srcdir)/testscale.c $(srcdir)/testutils.c
  244. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  245. testsem$(EXE): $(srcdir)/testsem.c
  246. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  247. testsensor$(EXE): $(srcdir)/testsensor.c
  248. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  249. testshader$(EXE): $(srcdir)/testshader.c
  250. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
  251. testshape$(EXE): $(srcdir)/testshape.c
  252. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  253. testsprite2$(EXE): $(srcdir)/testsprite2.c $(srcdir)/testutils.c
  254. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  255. testspriteminimal$(EXE): $(srcdir)/testspriteminimal.c $(srcdir)/testutils.c
  256. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  257. teststreaming$(EXE): $(srcdir)/teststreaming.c $(srcdir)/testutils.c
  258. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  259. testtimer$(EXE): $(srcdir)/testtimer.c
  260. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  261. testurl$(EXE): $(srcdir)/testurl.c
  262. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  263. testver$(EXE): $(srcdir)/testver.c
  264. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  265. testviewport$(EXE): $(srcdir)/testviewport.c $(srcdir)/testutils.c
  266. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  267. testwm2$(EXE): $(srcdir)/testwm2.c
  268. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  269. testyuv$(EXE): $(srcdir)/testyuv.c $(srcdir)/testyuv_cvt.c
  270. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  271. torturethread$(EXE): $(srcdir)/torturethread.c
  272. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  273. testrendercopyex$(EXE): $(srcdir)/testrendercopyex.c $(srcdir)/testutils.c
  274. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  275. testmessage$(EXE): $(srcdir)/testmessage.c
  276. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  277. testdisplayinfo$(EXE): $(srcdir)/testdisplayinfo.c
  278. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  279. testqsort$(EXE): $(srcdir)/testqsort.c
  280. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  281. testbounds$(EXE): $(srcdir)/testbounds.c
  282. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  283. testcustomcursor$(EXE): $(srcdir)/testcustomcursor.c
  284. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  285. controllermap$(EXE): $(srcdir)/controllermap.c $(srcdir)/testutils.c
  286. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  287. testvulkan$(EXE): $(srcdir)/testvulkan.c
  288. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  289. testlocale$(EXE): $(srcdir)/testlocale.c
  290. $(CC) -o $@ $? $(CFLAGS) $(LIBS)
  291. testmouse$(EXE): $(srcdir)/testmouse.c
  292. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  293. clean:
  294. rm -f $(TARGETS) *.test
  295. distclean: clean
  296. rm -f Makefile
  297. rm -f config.status config.cache config.log
  298. rm -rf $(srcdir)/autom4te*
  299. noninteractive = \
  300. testatomic$(EXE) \
  301. testerror$(EXE) \
  302. testevdev$(EXE) \
  303. testfilesystem$(EXE) \
  304. testkeys$(EXE) \
  305. testlocale$(EXE) \
  306. testplatform$(EXE) \
  307. testpower$(EXE) \
  308. testqsort$(EXE) \
  309. testthread$(EXE) \
  310. testtimer$(EXE) \
  311. testver$(EXE) \
  312. $(NULL)
  313. needs_audio = \
  314. testaudioinfo$(EXE) \
  315. testsurround$(EXE) \
  316. $(NULL)
  317. needs_display = \
  318. testbounds$(EXE) \
  319. testdisplayinfo$(EXE) \
  320. $(NULL)
  321. TESTS = $(noninteractive) $(needs_audio) $(needs_display)
  322. check:
  323. @set -e; \
  324. status=0; \
  325. export SDL_AUDIODRIVER=dummy; \
  326. export SDL_VIDEODRIVER=dummy; \
  327. for exe in $(TESTS); do \
  328. echo "$$exe..."; \
  329. if ./"$$exe"; then \
  330. echo "$$exe: OK"; \
  331. else \
  332. echo "$$exe: FAILED: $$?"; \
  333. status=1; \
  334. fi; \
  335. done; \
  336. exit "$$status"
  337. DATA = \
  338. axis.bmp \
  339. button.bmp \
  340. controllermap.bmp \
  341. controllermap_back.bmp \
  342. icon.bmp \
  343. moose.dat \
  344. sample.bmp \
  345. sample.wav \
  346. testgles2_sdf_img_normal.bmp \
  347. testgles2_sdf_img_sdf.bmp \
  348. testyuv.bmp \
  349. unifont-13.0.06.hex \
  350. utf8.txt \
  351. $(NULL)
  352. ifneq ($(srcdir), .)
  353. $(DATA) : %: $(srcdir)/% Makefile
  354. cp $< $@
  355. endif
  356. copydatafiles: $(DATA)
  357. .PHONY : copydatafiles