test: Add a make install target for the tests

This makes it more convenient to compile them alongside SDL, install
them in an optional package and use them as smoke-tests or diagnostic
tools. The default installation directory is taken from GNOME's
installed-tests, which seems as good a convention as any other:
https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2020-11-25 13:30:29 +00:00
committed by Sam Lantinga
parent 76a7b629bf
commit 38ef678990
4 changed files with 112 additions and 0 deletions

View File

@@ -2,6 +2,15 @@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
libexecdir = @libexecdir@
includedir = @includedir@
datarootdir = @datarootdir@
datadir = @datadir@
CC = @CC@
EXE = @EXE@
CFLAGS = @CFLAGS@ -g
@@ -81,6 +90,12 @@ TARGETS = \
all: Makefile $(TARGETS) copydatafiles
installedtestsdir = $(libexecdir)/installed-tests/SDL2
install: all
install -D -t $(DESTDIR)$(installedtestsdir) $(TARGETS)
install -m644 -D -t $(DESTDIR)$(installedtestsdir) $(DATA)
Makefile: $(srcdir)/Makefile.in
$(SHELL) config.status $@