3 # This is probably only going to work with GNU Make.
4 # This in a separate file instead of in Makefile.am because Automake complains
5 # about the GNU Make-isms.
9 PACKAGE_VERSION
= @PACKAGE_VERSION@
11 HOST_TRIPLET
= @HOST_TRIPLET@
13 LIB_VERSION
:= $(shell echo
$(PACKAGE_VERSION
) | sed
-e
's/[a-z].*//')
15 TESTNAME
= libsndfile-testsuite-
$(HOST_TRIPLET
)-$(PACKAGE_VERSION
)
17 TARBALL
= $(TESTNAME
).
tar.gz
19 # Find the test programs by grepping the script for the programs it executes.
20 testprogs
:= $(shell grep
'^\./' tests
/test_wrapper.sh | sed
-e
"s|./||" -e
"s/ .*//" |
sort | uniq
)
21 # Also add the programs not found by the above.
22 testprogs
+= sfversion@EXEEXT@ stdin_test@EXEEXT@ stdout_test@EXEEXT@ cpp_test@EXEEXT@ win32_test@EXEEXT@
24 # Find the single test program in src/ .
25 srcprogs
:= $(shell if
test -x src
/.libs
/test_main
$(EXEEXT
) ; then echo
"src/.libs/test_main$(EXEEXT)" ; else echo
"src/test_main$(EXEEXT)" ; fi
)
27 libfiles
:= $(shell if
test ! -z
$(EXEEXT
) ; then echo
"src/libsndfile-1.def src/.libs/libsndfile-1.dll" ; else echo
"src/.libs/libsndfile.so.$(LIB_VERSION)" ; fi
)
29 files
:= $(addprefix tests
/.libs
/,$(subst @EXEEXT@
,$(EXEEXT
),$(testprogs
))) $(libfiles
) $(srcprogs
)
35 rm -rf
$(TARBALL
) $(TESTNAME
)/
37 check : $(TESTNAME
)/test_wrapper.sh
38 (cd .
/$(TESTNAME
)/ && .
/test_wrapper.sh
)
40 $(TARBALL
) : $(TESTNAME
)/test_wrapper.sh
41 tar zcf
$@
$(TESTNAME
)
44 @echo
"Created : $(TARBALL)"
47 $(TESTNAME
)/test_wrapper.sh
: $(files
) tests
/test_wrapper.sh tests
/pedantic-header-test.sh
49 mkdir
-p
$(TESTNAME
)/tests
/
50 cp
$(files
) $(TESTNAME
)/tests
/
51 cp tests
/test_wrapper.sh
$(TESTNAME
)/
52 cp tests
/pedantic-header-test.sh
$(TESTNAME
)/tests
/
55 tests
/test_wrapper.sh
: tests
/test_wrapper.sh.in