Makefile.in 11 KB

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