You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
453 B

#!/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
for x in "$ROOT"*.h; do
echo "Trying build with $x"
rm -f "$TARGET"
(echo '/******** GENERATED FILE ********/'; cat "$x") > "$TARGET"
$MAKE "$ROOT"-test && break
echo "Failed build with $x"
rm -f "$TARGET"
done
rm -f "$ROOT"-test
test -f "$TARGET"