File: make-check-dev

package info (click to toggle)
primesieve 11.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 972 kB
  • sloc: cpp: 8,219; ansic: 723; sh: 197; makefile: 88
file content (48 lines) | stat: -rwxr-xr-x 1,416 bytes parent folder | download
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
#!/bin/sh
# autopkgtest check based on upstream cmake test ($ make test)
set -ue

mkdir -p $AUTOPKGTEST_TMP/tests
mkdir -p $AUTOPKGTEST_TMP/include/primesieve

cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/PreSieve.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/PrimeSieve.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/ParallelSieve.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/pod_vector.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/pmath.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/macros.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/calculator.hpp

cp -vpd -t $AUTOPKGTEST_TMP/tests test/*.c
cp -vpd -t $AUTOPKGTEST_TMP/tests test/*.cpp

cd $AUTOPKGTEST_TMP

cat > $AUTOPKGTEST_TMP/tests/GNUmakefile << EOF
#!/usr/bin/make -f

PROGRAMS = \
	\$(patsubst %.c,%,\$(wildcard *.c)) \
	\$(filter-out atomic cpu_info, \$(patsubst %.cpp,%,\$(wildcard *.cpp)) )

default: all

CFLAGS = \$(shell pkg-config primesieve --cflags)
CXXFLAGS = -I../include \$(shell pkg-config primesieve --cflags)
LDLIBS = \$(shell pkg-config primesieve --libs) -pthread

all: build

build: \$(PROGRAMS)

check: build
	\$(foreach tst, \$(PROGRAMS), echo "+-+-+-+ \$(tst) +-+-+-+" ; ./\$(tst) ; )

clean:
	\$(RM) \$(PROGRAMS)

EOF

make -C $AUTOPKGTEST_TMP/tests check

exit 0