Makefile.in 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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/SDL3
  85. installedtestsmetadir = $(datadir)/installed-tests/SDL3
  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. #there's probably a better way of doing this
  219. ifeq (@ISMACOSX@,false)
  220. ifeq (@ISWINDOWS@,false)
  221. ifeq (@ISUNIX@,false)
  222. testnative$(EXE): ;
  223. endif
  224. endif
  225. endif
  226. testoverlay2$(EXE): $(srcdir)/testoverlay2.c $(srcdir)/testyuv_cvt.c $(srcdir)/testutils.c
  227. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  228. testplatform$(EXE): $(srcdir)/testplatform.c
  229. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  230. testpower$(EXE): $(srcdir)/testpower.c
  231. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  232. testfilesystem$(EXE): $(srcdir)/testfilesystem.c
  233. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  234. testrendertarget$(EXE): $(srcdir)/testrendertarget.c $(srcdir)/testutils.c
  235. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  236. testscale$(EXE): $(srcdir)/testscale.c $(srcdir)/testutils.c
  237. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  238. testsem$(EXE): $(srcdir)/testsem.c
  239. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  240. testsensor$(EXE): $(srcdir)/testsensor.c
  241. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  242. testshader$(EXE): $(srcdir)/testshader.c
  243. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
  244. testshape$(EXE): $(srcdir)/testshape.c
  245. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  246. testsprite2$(EXE): $(srcdir)/testsprite2.c $(srcdir)/testutils.c
  247. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  248. testspriteminimal$(EXE): $(srcdir)/testspriteminimal.c $(srcdir)/testutils.c
  249. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  250. teststreaming$(EXE): $(srcdir)/teststreaming.c $(srcdir)/testutils.c
  251. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  252. testtimer$(EXE): $(srcdir)/testtimer.c
  253. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  254. testurl$(EXE): $(srcdir)/testurl.c
  255. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  256. testver$(EXE): $(srcdir)/testver.c
  257. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  258. testviewport$(EXE): $(srcdir)/testviewport.c $(srcdir)/testutils.c
  259. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  260. testwm2$(EXE): $(srcdir)/testwm2.c
  261. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  262. testyuv$(EXE): $(srcdir)/testyuv.c $(srcdir)/testyuv_cvt.c
  263. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  264. torturethread$(EXE): $(srcdir)/torturethread.c
  265. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  266. testrendercopyex$(EXE): $(srcdir)/testrendercopyex.c $(srcdir)/testutils.c
  267. $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
  268. testmessage$(EXE): $(srcdir)/testmessage.c
  269. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  270. testdisplayinfo$(EXE): $(srcdir)/testdisplayinfo.c
  271. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  272. testqsort$(EXE): $(srcdir)/testqsort.c
  273. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  274. testbounds$(EXE): $(srcdir)/testbounds.c
  275. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  276. testcustomcursor$(EXE): $(srcdir)/testcustomcursor.c
  277. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  278. controllermap$(EXE): $(srcdir)/controllermap.c $(srcdir)/testutils.c
  279. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  280. testvulkan$(EXE): $(srcdir)/testvulkan.c
  281. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  282. testlocale$(EXE): $(srcdir)/testlocale.c
  283. $(CC) -o $@ $? $(CFLAGS) $(LIBS)
  284. testmouse$(EXE): $(srcdir)/testmouse.c
  285. $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  286. clean:
  287. rm -f $(TARGETS) *.test
  288. distclean: clean
  289. rm -f Makefile
  290. rm -f config.status config.cache config.log
  291. rm -rf $(srcdir)/autom4te*
  292. noninteractive = \
  293. testatomic$(EXE) \
  294. testerror$(EXE) \
  295. testevdev$(EXE) \
  296. testfilesystem$(EXE) \
  297. testkeys$(EXE) \
  298. testlocale$(EXE) \
  299. testplatform$(EXE) \
  300. testpower$(EXE) \
  301. testqsort$(EXE) \
  302. testthread$(EXE) \
  303. testtimer$(EXE) \
  304. testver$(EXE) \
  305. $(NULL)
  306. needs_audio = \
  307. testaudioinfo$(EXE) \
  308. testsurround$(EXE) \
  309. $(NULL)
  310. needs_display = \
  311. testbounds$(EXE) \
  312. testdisplayinfo$(EXE) \
  313. $(NULL)
  314. TESTS = $(noninteractive) $(needs_audio) $(needs_display)
  315. check:
  316. @set -e; \
  317. status=0; \
  318. export SDL_AUDIODRIVER=dummy; \
  319. export SDL_VIDEODRIVER=dummy; \
  320. for exe in $(TESTS); do \
  321. echo "$$exe..."; \
  322. if ./"$$exe"; then \
  323. echo "$$exe: OK"; \
  324. else \
  325. echo "$$exe: FAILED: $$?"; \
  326. status=1; \
  327. fi; \
  328. done; \
  329. exit "$$status"
  330. DATA = \
  331. axis.bmp \
  332. button.bmp \
  333. controllermap.bmp \
  334. controllermap_back.bmp \
  335. icon.bmp \
  336. moose.dat \
  337. sample.bmp \
  338. sample.wav \
  339. testgles2_sdf_img_normal.bmp \
  340. testgles2_sdf_img_sdf.bmp \
  341. testyuv.bmp \
  342. unifont-13.0.06.hex \
  343. utf8.txt \
  344. $(NULL)
  345. ifneq ($(srcdir), .)
  346. $(DATA) : %: $(srcdir)/% Makefile
  347. cp $< $@
  348. endif
  349. copydatafiles: $(DATA)
  350. .PHONY : copydatafiles