2006-09-07 02:08:06 +04:00
#!/bin/sh
2010-07-05 17:24:27 +04:00
if [ " $1 " = "--full" ] ; then
FULL = 1
shift 1
else
FULL = 0
fi
2011-02-02 20:53:54 +03:00
ARGS = " --includedir=../librpc/idl --outputdir $PIDL_OUTPUTDIR --header --ndr-parser --client --samba3-ndr-server $PIDL_ARGS -- "
2008-10-15 03:53:09 +04:00
IDL_FILES = " $* "
2006-09-07 02:08:06 +04:00
oldpwd = ` pwd `
cd ${ srcdir }
2008-12-16 17:42:47 +03:00
[ -d $PIDL_OUTPUTDIR ] || mkdir -p $PIDL_OUTPUTDIR || exit 1
2006-09-07 02:08:06 +04:00
2008-10-15 03:53:09 +04:00
PIDL = " $PIDL $ARGS "
2006-09-07 02:08:06 +04:00
2010-07-05 17:24:27 +04:00
if [ $FULL = 1 ] ; then
echo "Rebuilding all idl files"
$PIDL $IDL_FILES || exit 1
exit 0
fi
2006-09-08 00:09:15 +04:00
##
## Find newer files rather than rebuild all of them
##
2006-09-07 02:08:06 +04:00
list = ""
for f in ${ IDL_FILES } ; do
2010-05-04 09:48:54 +04:00
b = ` basename $f .idl`
2011-02-02 20:53:54 +03:00
outfiles = " $b .h ndr_ $b .h srv_ $b .c "
outfiles = " $outfiles ndr_ $b .c srv_ $b .h "
2010-05-04 09:48:54 +04:00
for o in $outfiles ; do
[ -f $PIDL_OUTPUTDIR /$o ] || {
list = " $list $f "
break
}
2010-05-07 15:45:00 +04:00
test " `find $f -newer $PIDL_OUTPUTDIR / $o ` " != "" && {
2008-10-15 03:53:09 +04:00
list = " $list $f "
2010-05-04 09:48:54 +04:00
break
}
done
2006-09-07 02:08:06 +04:00
done
2006-09-08 00:09:15 +04:00
##
## generate the ndr stubs
##
2006-09-07 02:08:06 +04:00
if [ " x $list " != x ] ; then
2006-09-11 19:55:44 +04:00
# echo "${PIDL} ${list}"
2006-09-07 02:08:06 +04:00
$PIDL $list || exit 1
fi
cd ${ oldpwd }
exit 0
2006-09-08 00:09:15 +04:00