#!/bin/sh

PATH=../../daemon:../../coss/naming:../../imr:../../ir:../../idl:../../cpp:$PATH
export PATH
IRADDR=inet:`uname -n`:12500

MICOINC=../../include

IDLPAR="-I$MICOINC"

printf "Starting IRD ..."
ird --db=ir-db -ORBIIOPAddr $IRADDR 2>/dev/null &
ird_pid=$!
sleep 2
echo $ird_pid > ird.pid
echo done.

if [ ! -f ir-db.idl ]
then

printf "Send ir_base.idl to IR ..."
idl $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/ir_base.idl
echo "done."

printf "Send ir.idl to IR ..."
idl $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/mico/ir.idl
echo "done."

printf "Send CosObjectIdentity.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/coss/CosObjectIdentity.idl
echo "done."

printf "Send CosNaming.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/coss/CosNaming.idl
echo "done."

printf "Send CosLifeCycle.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/coss/CosLifeCycle.idl
echo "done."

printf "Send CosRelationships.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/coss/CosRelationships.idl
echo "done."

printf "Send CosGraphs.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/coss/CosGraphs.idl
echo "done."

printf "Send CosExternalization.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir $MICOINC/coss/CosExternalization.idl
echo "done."

printf "Send hello.idl to IR ..."
idl   $IDLPAR -ORBIfaceRepoAddr $IRADDR --no-codegen-c++ --feed-ir ./hello.idl
echo "done."

fi

