#!/bin/bash

. buildsys/functions

ProcessArgs $*
Assert LoadConfigs
Assert SetupResFile

cd ../../..

SetState "Configuring"

if [ "$DEP" != "none" ]
then
   OSPL_HOME=$DEPWORKDIR
   export OSPL_HOME
fi

SPLICE_PLATFORM=$SETUP_TYPE
export SPLICE_PLATFORM
. ./configure -full
if [ "$CONFIGURATION" != "OK" ]
then
    echo "ERROR: configuration - dcps_build"
    exit 1
fi

SetState "Building"

echo "BUILD=RUNNING" >> $RESFILE
ArchiveLogs

make
if [ $? != 0 ] 
then
    exit 2
fi
exit 0