s3: Fix bug #9085.
[Samba.git] / source3 / script / build_idl.sh
blob0f4908114edba03311050e72f4b5f0247d812ff7
1 #!/bin/sh
3 ARGS="--includedir=../librpc/idl --outputdir $PIDL_OUTPUTDIR --header --ndr-parser --samba3-ndr-server --samba3-ndr-client $PIDL_ARGS --"
4 IDL_FILES="$*"
6 oldpwd=`pwd`
7 cd ${srcdir}
9 [ -d $PIDL_OUTPUTDIR ] || mkdir -p $PIDL_OUTPUTDIR || exit 1
11 PIDL="$PIDL $ARGS"
14 ## Find newer files rather than rebuild all of them
17 list=""
18 for f in ${IDL_FILES}; do
19 basename=`basename $f .idl`
20 ndr="$PIDL_OUTPUTDIR/ndr_$basename.c"
22 if [ -f $ndr ]; then
23 if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then
24 list="$list $f"
26 else
27 list="$list $f"
29 done
32 ## generate the ndr stubs
35 if [ "x$list" != x ]; then
36 # echo "${PIDL} ${list}"
37 $PIDL $list || exit 1
40 cd ${oldpwd}
42 exit 0