comparison src/libsndfile-1.0.27/Scripts/build-test-tarball.mk.in @ 125:cd6cdf86811e

Current libsndfile source
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 18 Oct 2016 13:22:47 +0100
parents
children
comparison
equal deleted inserted replaced
124:e3d5853d5918 125:cd6cdf86811e
1 #!/usr/bin/make -f
2
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.
6
7 EXEEXT = @EXEEXT@
8
9 PACKAGE_VERSION = @PACKAGE_VERSION@
10
11 HOST_TRIPLET = @HOST_TRIPLET@
12
13 SRC_BINDIR = @SRC_BINDIR@
14 TEST_BINDIR = @TEST_BINDIR@
15
16 LIBRARY := $(SRC_BINDIR)libsndfile.so.$(LIB_VERSION)
17
18 LIB_VERSION := $(shell echo $(PACKAGE_VERSION) | sed -e 's/[a-z].*//')
19
20 TESTNAME = libsndfile-testsuite-$(HOST_TRIPLET)-$(PACKAGE_VERSION)
21
22 TARBALL = $(TESTNAME).tar.gz
23
24 # Find the test programs by grepping the script for the programs it executes.
25 testprogs := $(shell grep '^\./' tests/test_wrapper.sh | sed -e "s|./||" -e "s/ .*//" | sort | uniq)
26 # Also add the programs not found by the above.
27 testprogs += sfversion@EXEEXT@ stdin_test@EXEEXT@ stdout_test@EXEEXT@ cpp_test@EXEEXT@ win32_test@EXEEXT@
28
29 # Find the single test program in src/ .
30 srcprogs := $(shell if test -x src/.libs/test_main$(EXEEXT) ; then echo "src/.libs/test_main$(EXEEXT)" ; else echo "src/test_main$(EXEEXT)" ; fi)
31
32 libfiles := $(shell if test ! -z $(EXEEXT) ; then echo "src/libsndfile-1.def src/.libs/libsndfile-1.dll" ; elif test -f $(LIBRARY) ; then echo $(LIBRARY) ; fi ; fi)
33
34 testbins := $(addprefix $(TEST_BINDIR),$(subst @EXEEXT@,$(EXEEXT),$(testprogs))) $(libfiles) $(srcprogs)
35
36
37 all : $(TARBALL)
38
39 clean :
40 rm -rf $(TARBALL) $(TESTNAME)/
41
42 check : $(TESTNAME)/test_wrapper.sh
43 (cd ./$(TESTNAME)/ && ./test_wrapper.sh)
44
45 $(TARBALL) : $(TESTNAME)/test_wrapper.sh
46 tar zcf $@ $(TESTNAME)
47 rm -rf $(TESTNAME)
48 @echo
49 @echo "Created : $(TARBALL)"
50 @echo
51
52 $(TESTNAME)/test_wrapper.sh : $(testbins) tests/test_wrapper.sh tests/pedantic-header-test.sh
53 rm -rf $(TESTNAME)
54 mkdir -p $(TESTNAME)/tests/
55 cp $(testbins) $(TESTNAME)/tests/
56 cp tests/test_wrapper.sh $(TESTNAME)/
57 cp tests/pedantic-header-test.sh $(TESTNAME)/tests/
58 chmod u+x $@
59
60 tests/test_wrapper.sh : tests/test_wrapper.sh.in
61 (cd tests/ ; make $@)