#!/bin/sh
#
#                             IPSTB Project
#                   ---------------------------------
#
# Copyright (C) 2006 NXP Semiconductors B.V.,
# All Rights Reserved.
#
# Filename: build.sh
#
# Builds phStbIpc_ServerApp and phStbIpc_ClientApp test applications/modules.
#
# Rev Date       Author      Comments
#-------------------------------------------------------------------------------
#   1 20061221   batelaan    Initial
#   2 20070102   batelaan    Also build client kernel module.
#   3 20070208   batelaan    Use little endian. Cope with CPUBUILDROOT already being set.
#   4 20070209   batelaan    Crosscheck fix.
#   5 20070214   batelaan    Derive tstdir from this script's location.
#   6 20070329   batelaan    Don't compile phStbIpc module itself here.
#   7 20070720   batelaan    Deprecate KMODULE and KERNEL_MODE vars

tstdir=`cd "${BASH_SOURCE[0]%/*}" >&/dev/null && pwd`

modulescmd="cbuild _TMDIVERSITY+=kmodule $tstdir/Client $tstdir/Server -M all kmodule_install --"
appscmd="cbuild -r $tstdir/Client $tstdir/Server"

if [ -z "$CPUBUILDROOT" ]; then
  prjlmake cmd="$modulescmd" control.shell \
    && \
  prjlmake cmd="$appscmd" \
    control.shell \
    dsp.shell \
    stb225/control/x86-pc-le.shell
else
  eval $modulescmd && $appscmd
fi
