Makefile.in 11 KB

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