File: build_test_wrapper

package info (click to toggle)
rtpengine 13.5.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 13,676 kB
  • sloc: ansic: 86,764; perl: 59,422; python: 3,193; sh: 1,030; makefile: 693; asm: 211
file content (30 lines) | stat: -rwxr-xr-x 714 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
#!/bin/sh
TARGET=$1
ROOT=$(echo "$TARGET" | sed 's/\.h$//')
if test "$MAKE" = ""; then
	# shellcheck disable=SC2209
	MAKE=make
fi
echo "Looking for usable alternative for $TARGET"
rm -f "$ROOT"-test
rm -f .stderr.$$
for x in "$ROOT"*.h; do
	echo "Trying build with $x"
	rm -f "$TARGET"
	(echo '/******** GENERATED FILE ********/'; cat "$x") > "$TARGET"
	$MAKE "$ROOT"-test 2>> .stderr.$$ && break
	echo "Failed build with $x"
	rm -f "$TARGET"
done
rm -f "$ROOT"-test
if test -f "$TARGET"; then
	rm -f .stderr.$$
	exit 0
fi
echo "Failed to find usable build alternative for $TARGET"
echo "Collected stderr:"
echo "--------------------------"
cat .stderr.$$
rm -f .stderr.$$
echo "--------------------------"
exit 1