added auto-generation of the server side boilerplate code for each
[sfrench/samba-autobuild/.git] / source / script / build_idl.sh
1 #!/bin/sh
2
3 FULLBUILD=$1
4
5 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
6
7 PIDL="build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser --server"
8 TABLES="build/pidl/tables.pl --output librpc/gen_ndr/tables"
9
10 if [ x$FULLBUILD = xFULL ]; then
11       echo Rebuilding all idl files in librpc/idl
12       $PIDL librpc/idl/*.idl || exit 1
13
14       echo Rebuilding IDL tables
15       $TABLES librpc/gen_ndr/ndr_*.h || exit 1
16       exit 0
17 fi
18
19 list=""
20
21 for f in librpc/idl/*.idl; do
22     basename=`basename $f .idl`
23     if [ "$f" -nt librpc/gen_ndr/ndr_$basename.c ]; then
24         list="$list $f"
25     fi
26 done
27
28 if [ "x$list" != x ]; then
29     $PIDL $list || exit 1
30     $TABLES librpc/gen_ndr/ndr_*.h || exit 1
31 fi
32
33 exit 0