annotate src/libsndfile-1.0.27/Scripts/build-test-tarball.mk.in @ 127:7867fa7e1b6b

Current fftw source
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 18 Oct 2016 13:40:26 +0100
parents cd6cdf86811e
children
rev   line source
cannam@125 1 #!/usr/bin/make -f
cannam@125 2
cannam@125 3 # This is probably only going to work with GNU Make.
cannam@125 4 # This in a separate file instead of in Makefile.am because Automake complains
cannam@125 5 # about the GNU Make-isms.
cannam@125 6
cannam@125 7 EXEEXT = @EXEEXT@
cannam@125 8
cannam@125 9 PACKAGE_VERSION = @PACKAGE_VERSION@
cannam@125 10
cannam@125 11 HOST_TRIPLET = @HOST_TRIPLET@
cannam@125 12
cannam@125 13 SRC_BINDIR = @SRC_BINDIR@
cannam@125 14 TEST_BINDIR = @TEST_BINDIR@
cannam@125 15
cannam@125 16 LIBRARY := $(SRC_BINDIR)libsndfile.so.$(LIB_VERSION)
cannam@125 17
cannam@125 18 LIB_VERSION := $(shell echo $(PACKAGE_VERSION) | sed -e 's/[a-z].*//')
cannam@125 19
cannam@125 20 TESTNAME = libsndfile-testsuite-$(HOST_TRIPLET)-$(PACKAGE_VERSION)
cannam@125 21
cannam@125 22 TARBALL = $(TESTNAME).tar.gz
cannam@125 23
cannam@125 24 # Find the test programs by grepping the script for the programs it executes.
cannam@125 25 testprogs := $(shell grep '^\./' tests/test_wrapper.sh | sed -e "s|./||" -e "s/ .*//" | sort | uniq)
cannam@125 26 # Also add the programs not found by the above.
cannam@125 27 testprogs += sfversion@EXEEXT@ stdin_test@EXEEXT@ stdout_test@EXEEXT@ cpp_test@EXEEXT@ win32_test@EXEEXT@
cannam@125 28
cannam@125 29 # Find the single test program in src/ .
cannam@125 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)
cannam@125 31
cannam@125 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)
cannam@125 33
cannam@125 34 testbins := $(addprefix $(TEST_BINDIR),$(subst @EXEEXT@,$(EXEEXT),$(testprogs))) $(libfiles) $(srcprogs)
cannam@125 35
cannam@125 36
cannam@125 37 all : $(TARBALL)
cannam@125 38
cannam@125 39 clean :
cannam@125 40 rm -rf $(TARBALL) $(TESTNAME)/
cannam@125 41
cannam@125 42 check : $(TESTNAME)/test_wrapper.sh
cannam@125 43 (cd ./$(TESTNAME)/ && ./test_wrapper.sh)
cannam@125 44
cannam@125 45 $(TARBALL) : $(TESTNAME)/test_wrapper.sh
cannam@125 46 tar zcf $@ $(TESTNAME)
cannam@125 47 rm -rf $(TESTNAME)
cannam@125 48 @echo
cannam@125 49 @echo "Created : $(TARBALL)"
cannam@125 50 @echo
cannam@125 51
cannam@125 52 $(TESTNAME)/test_wrapper.sh : $(testbins) tests/test_wrapper.sh tests/pedantic-header-test.sh
cannam@125 53 rm -rf $(TESTNAME)
cannam@125 54 mkdir -p $(TESTNAME)/tests/
cannam@125 55 cp $(testbins) $(TESTNAME)/tests/
cannam@125 56 cp tests/test_wrapper.sh $(TESTNAME)/
cannam@125 57 cp tests/pedantic-header-test.sh $(TESTNAME)/tests/
cannam@125 58 chmod u+x $@
cannam@125 59
cannam@125 60 tests/test_wrapper.sh : tests/test_wrapper.sh.in
cannam@125 61 (cd tests/ ; make $@)