Add support for multiple targets

This commit is contained in:
Pierre Pronchery 2015-10-04 12:52:40 +02:00
parent 1cb6982bbd
commit adfa5b11ed

View File

@ -31,10 +31,20 @@ APPBROKER="AppBroker"
#functions #functions
#appbroker
_appbroker()
{
target="$1"
appinterface="$2"
$APPBROKER -o "$target" "$appinterface"
}
#usage #usage
_usage() _usage()
{ {
echo "Usage: $PROGNAME [-c][-P prefix] target" 1>&2 echo "Usage: $PROGNAME [-c][-P prefix] target..." 1>&2
return 1 return 1
} }
@ -59,15 +69,19 @@ while getopts "cO:P:" name; do
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
if [ $# -ne 1 ]; then if [ $# -eq 0 ]; then
_usage _usage
exit $? exit $?
fi fi
[ "$clean" -ne 0 ] && exit 0 [ "$clean" -ne 0 ] && exit 0
target="$1" while [ $# -gt 0 ]; do
source="${target#$OBJDIR}" target="$1"
APPINTERFACE="${source##*/}" shift
APPINTERFACE="../data/${APPINTERFACE%%.h}.interface"
$APPBROKER -o "$target" "$APPINTERFACE" source="${target#$OBJDIR}"
appinterface="${source##*/}"
appinterface="../data/${appinterface%%.h}.interface"
_appbroker "$target" "$appinterface" || exit 2
done