#
#                             IPSTB Project
#                   ---------------------------------
#
# Copyright (C) 2007 NXP B.V.,
# All Rights Reserved.
#
# Filename: makefile phStbDbg component
#
#
# Rev Date       Author      Comments
#-------------------------------------------------------------------------------
#   1 20050628   batelaan    Original
#   2 20050714   charrett    Create a .so file as well as a normal library
#   3 20050905   batelaan    LOCAL_CFLAGS += -DDBG_ENABLE_ALL
#   4 20060815   awest       C_SOURCES : ifeq ($(strip $(TMFL_OS_IS_LINUX)),1)
#   5 20060824   G.Lawrance  Support building as linux module
#   6 20070301   batelaan    Make EXPORTS a global variable.
#   7 20070705   batelaan    WinCE compilation.
#   8 20070720   batelaan    Deprecate KMODULE and KERNEL_MODE vars
#   9 20070807   batelaan    Add diversity.mk
#  10 20070813   batelaan    Add EXPORTS for WinCE
#  11 20070921   batelaan    Add KMODULE_INCLUDED_COMPS
#  12 20071016   batelaan    Export missing symbols
#  13 20071023   batelaan    WinCE portability.
#  14 20071026   batelaan    Add gphStbDbg_DbgUnit to EXPORTS
#  15 20071128   hutchinson  Export tmDbg_Init, phStbDbg_DbgUnit
#                            NOTE: can't export non-function symbols on WinCE!
#  16 20081107   batelaan    Add phStbDbg_Tree.c
#  xx 20091208   amccurdy    Remove CE support
#---------------------------------------------------------------------------
DIR_LOCAL       = comps/phStbDbg

#***********************************************************************
# Do not change the following include
#***********************************************************************
include $(_TMROOT)/sde/environment.mk

#-----------------------------------------------------------------------
# Source environment variables
#-----------------------------------------------------------------------
ifeq ($(TMFL_CPU_IS_TM),1)
  C_SOURCES = \
    src/phStbDbg_TM.c
endif

ifeq ($(TMFL_OS_IS_LINUX),1)
  ifeq "$(TMFL_MODE_KERNEL)" "1"
    C_SOURCES = \
      src/kmodule/phStbDbg_Tree.c \
      src/kmodule/phStbDbg_Module.c \
      src/kmodule/phStbDbg_ModuleCommon.c
    DIR_INCLUDE = \
      $(_phStbDbg_DIR)/src/kmodule
  else
    C_SOURCES = \
      src/phStbDbg_Linux.c
  endif
endif

#-----------------------------------------------------------------------
# Required components
#-----------------------------------------------------------------------
REQUIRES = \
  IphStbCommon \

LIBS = \

ifeq ($(TMFL_CPU_IS_TM),1)
REQUIRES += \
  Itmosal \
  Itmml \
  tmDbg \

LIBS += \
  tmDbg \

endif

ifeq ($(TMFL_CPU_IS_MIPS),1)
REQUIRES += \

LIBS += \

endif

# KMODULE_INCLUDED_COMPS to be defined if the component represents a kernel module.
# A list of other components included in this kernel module.
KMODULE_INCLUDED_COMPS = \

#-----------------------------------------------------------------------
# Flags
#-----------------------------------------------------------------------

# For this component always compile as if DBG_PRINT and DBG_ASSERT macros are enabled:
LOCAL_CFLAGS += -DDBG_ENABLE_ALL

ifdef STBDBG_UNITTEST
  LOCAL_CFLAGS += -DUNITTEST
endif

#-----------------------------------------------------------------------
# EXPORTS
#-----------------------------------------------------------------------

ifeq "$(TMFL_MODE_KERNEL)" "1"
EXPORTS += \
  tmDbg_Print \
  tmDbg_RegisterModule \
  tmDbg_AssertError \
  tmDbg_StrAssertFormat \
  tmDbg_KeySet \
  tmDbg_KeyGet \
  tmDbg_KeyNext \
  phStbDbg_DbgUnit
endif

#-----------------------------------------------------------------------
# Diversity
#-----------------------------------------------------------------------

include diversity.mk
LIB_SUFFIX = $(_phStbDbg_DIVERSITY)
LOCAL_CFLAGS += -DPH_STBDBG_CPU_NAME=$(if $(findstring _dsp_,$(_TMDIVERSITY)),mips2,mips1)

#-----------------------------------------------------------------------
# Do not change this
#-----------------------------------------------------------------------
all: configuration lib

ifneq ($(DIR_CONFIG),_)
include $(DIR_SDE)/$(DIR_CONFIG)/makelib.mk
endif
