summaryrefslogtreecommitdiffstats
path: root/rules/sdl2-test.make
blob: afa09e63b39d1ab0b68959b25878378b8ef5d458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# -*-makefile-*-
#
# Copyright (C) 2018 by Michael Grzeschik
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_SDL2_TEST) += sdl2-test

#
# Paths and names
#
SDL2_TEST_VERSION	= $(SDL2_VERSION)
SDL2_TEST_MD5		= $(SDL2_MD5)
SDL2_TEST		= SDL2_test-$(SDL2_VERSION)
SDL2_TEST_SUFFIX	= $(SDL2_SUFFIX)
SDL2_TEST_URL		= $(SDL2_URL)
SDL2_TEST_SOURCE	= $(SDL2_SOURCE)
SDL2_TEST_DIR		= $(BUILDDIR)/$(SDL2_TEST)
SDL2_TEST_SUBDIR	:= test
SDL2_TESTS_LICENSE	:= zlib

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

SDL2_TEST_ENV		:= \
	$(CROSS_ENV) \
	SDL_LIBS="-lSDL2 -lunwind -lunwind-generic"

#
# autoconf
#
SDL2_TEST_CONF_TOOL	:= autoconf
SDL2_TEST_CONF_OPT	:= \
	$(CROSS_AUTOCONF_USR) \
	--$(call ptx/endis,PTXCONF_SDL2_OPENGL)-opengl

ifdef PTXCONF_SDL2_PULSEAUDIO
SDL2_TEST_LDFLAGS	:= \
	-Wl,-rpath-link,$(SYSROOT)/usr/lib/pulseaudio
endif

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

SDL2_TEST_TOOLS := \
	checkkeys \
	controllermap \
	loopwave \
	loopwavequeue \
	testatomic \
	testaudiocapture \
	testaudiohotplug \
	testaudioinfo \
	testautomation \
	testbounds \
	testcustomcursor \
	testdisplayinfo \
	testdraw2 \
	testdrawchessboard \
	testdropfile \
	testerror \
	testfile \
	testfilesystem \
	testgamecontroller \
	testgesture \
	testhaptic \
	testhittesting \
	testhotplug \
	testiconv \
	testime \
	testintersections \
	testjoystick \
	testkeys \
	testloadso \
	testlock \
	testmessage \
	testmultiaudio \
	testnative \
	testoverlay2 \
	testplatform \
	testpower \
	testqsort \
	testrelative \
	testrendercopyex \
	testrendertarget \
	testresample \
	testrumble \
	testscale \
	testsem \
	testshape \
	testsprite2 \
	testspriteminimal \
	teststreaming \
	testthread \
	testtimer \
	testver \
	testviewport \
	testvulkan \
	testwm2 \
	testyuv \
	torturethread

ifdef PTXCONF_SDL2_OPENGL
SDL2_TEST_TOOLS += \
	testgl2 \
	testshader
endif

ifdef PTXCONF_SDL2_OPENGLES1
SDL2_TEST_TOOLS += testgles
endif

ifdef PTXCONF_SDL2_OPENGLES2
SDL2_TEST_TOOLS += testgles2
endif

SDL2_TEST_DATA := \
	axis.bmp \
	button.bmp \
	controllermap.bmp \
	icon.bmp \
	sample.bmp \
	testyuv.bmp \
	sample.wav \
	picture.xbm \
	moose.dat \
	utf8.txt

$(STATEDIR)/sdl2-test.install:
	@$(call targetinfo)
	@$(foreach file, $(SDL2_TEST_TOOLS), \
	     install -vD -m 0755 $(SDL2_TEST_DIR)/$(SDL2_TEST_SUBDIR)/$(file) \
	       $(SDL2_TEST_PKGDIR)/usr/bin/sdl2tests/$(file)$(ptx/nl))
	@$(foreach file, $(SDL2_TEST_DATA), \
	     install -vD -m 0644 $(SDL2_TEST_DIR)/$(SDL2_TEST_SUBDIR)/$(file) \
	       $(SDL2_TEST_PKGDIR)/usr/bin/sdl2tests/$(file)$(ptx/nl))
	@$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/sdl2-test.targetinstall:
	@$(call targetinfo)

	@$(call install_init, sdl2-test)
	@$(call install_fixup, sdl2-test,PRIORITY,optional)
	@$(call install_fixup, sdl2-test,SECTION,base)
	@$(call install_fixup, sdl2-test,AUTHOR,"Michael Grzeschik <mgr@pengutronix.de>")
	@$(call install_fixup, sdl2-test,DESCRIPTION,missing)

	@$(foreach file, $(SDL2_TEST_TOOLS), \
		$(call install_copy, sdl2-test, 0, 0, 755, -, \
				/usr/bin/sdl2tests/$(file))$(ptx/nl))

	@$(foreach file, $(SDL2_TEST_DATA), \
		$(call install_copy, sdl2-test, 0, 0, 644, -, \
				/usr/bin/sdl2tests/$(file))$(ptx/nl))

	@$(call install_finish, sdl2-test)

	@$(call touch)

# vim: syntax=make