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.
 
 
 

53 lines
970 B

#!/bin/bash
DIR="$(dirname $0)/../include"
COMPILER="$1"
OUT="$2"
shift
shift
declare -a EXCLUDE_ACTIONS=( $@ )
included()
{
local name="$1"
local i=0
while [ $i -lt ${#EXCLUDE_ACTIONS[@]} ]; do
if [ "$name" == "${EXCLUDE_ACTIONS[$i]}" ]; then
return 1
fi
let i++
done
return 0
}
if [ -z "$COMPILER" ]; then
exit 1
fi
actlist=""
echo "">"$OUT"
cdir="$(pwd)"
pushd "$DIR">/dev/null
for f in ../actions/action*.h ../actions-add/action*.h; do
if [ -f "$f" ]; then
# echo Compiler=$COMPILER
# echo Exclude list=${EXCLUDE_ACTIONS[@]}
name="$($COMPILER -E -DGENACTIONLIST "$f" 2>/dev/null| grep "ADD ACTION CLASS: " | sed "s/.*: //")"
name=${name//;/}
if included "$name"; then
pushd "$cdir">/dev/null
echo "#include \"$f\"">>"$OUT"
actlist+=" Action$name"
popd>/dev/null
fi
fi
done
actlist=${actlist## }
actlist=${actlist%% }
actlist=${actlist// /,}
pushd "$cdir">/dev/null
echo "#define ACTLIST $actlist">>"$OUT"
popd>/dev/null