Makefile.in 11 KB

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