File: build-test-tarball.mk.in

package info (click to toggle)
libsndfile 1.2.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,180 kB
  • sloc: ansic: 55,354; cpp: 1,108; python: 791; makefile: 545; sh: 538; cs: 122
file content (61 lines) | stat: -rw-r--r-- 1,755 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/make -f

# This is probably only going to work with GNU Make.
# This in a separate file instead of in Makefile.am because Automake complains
# about the GNU Make-isms.

EXEEXT = @EXEEXT@

PACKAGE_VERSION = @PACKAGE_VERSION@

HOST_TRIPLET = @HOST_TRIPLET@

SRC_BINDIR = @SRC_BINDIR@
TEST_BINDIR = @TEST_BINDIR@

LIBRARY := $(SRC_BINDIR)libsndfile.so.$(LIB_VERSION)

LIB_VERSION := $(shell echo $(PACKAGE_VERSION) | sed -e 's/[a-z].*//')

TESTNAME = libsndfile-testsuite-$(HOST_TRIPLET)-$(PACKAGE_VERSION)

TARBALL = $(TESTNAME).tar.gz

# Find the test programs by grepping the script for the programs it executes.
testprogs := $(shell grep '^\./' tests/test_wrapper.sh | sed -e "s|./||" -e "s/ .*//" | sort | uniq)
# Also add the programs not found by the above.
testprogs += tests/sfversion$(EXEEXT) tests/stdin_test$(EXEEXT) tests/stdout_test$(EXEEXT) \
				tests/cpp_test$(EXEEXT) tests/win32_test$(EXEEXT)

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)

testbins := $(testprogs) $(libfiles)

all : $(TARBALL)

clean :
	rm -rf $(TARBALL) $(TESTNAME)/

check : $(TESTNAME)/test_wrapper.sh
	(cd ./$(TESTNAME)/ && ./test_wrapper.sh)

$(TARBALL) : $(TESTNAME)/test_wrapper.sh
	tar zcf $@ $(TESTNAME)
	rm -rf $(TESTNAME)
	@echo
	@echo "Created : $(TARBALL)"
	@echo

$(TESTNAME)/test_wrapper.sh : tests/test_wrapper.sh tests/pedantic-header-test.sh
	rm -rf $(TESTNAME)
	mkdir -p $(TESTNAME)/tests/
	echo
	echo $(testbins)
	echo
	cp $(testbins) $(TESTNAME)/tests/
	cp tests/test_wrapper.sh $(TESTNAME)/
	cp tests/pedantic-header-test.sh $(TESTNAME)/tests/
	chmod u+x $@

tests/test_wrapper.sh : tests/test_wrapper.sh.in
	make $@