#===============================================================================
# DAL I2CPD Libs
#
# GENERAL DESCRIPTION
#    DAL I2C Libs build script
#
# Copyright (c) 2009-2010 by QUALCOMM, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //source/qcom/qct/core/buses/i2c/rel/1H11/dalpd/legacy/build/SConscript#1 $
#  $DateTime: 2011/06/07 08:56:37 $
#  $Author: lkodheli $
#  $Change: 1780292 $
#                      EDIT HISTORY FOR FILE
#                      
#  This section contains comments describing changes made to the module.
#  Notice that changes are listed in reverse chronological order.
#  
# when       who     what, where, why
# --------   ---     ---------------------------------------------------------
# 07/10/09   MJS     Merged to SCMM qcore tip.
#===============================================================================
Import('env')
env = env.Clone()

#-------------------------------------------------------------------------------
# Source PATH
#-------------------------------------------------------------------------------
SRCPATH = ".."

env.VariantDir('${BUILDPATH}', SRCPATH, duplicate=0) 

if env['MSM_ID'] in ['8650', '8650B']:
   env.Replace(MSM_ID = '8650B')
elif env['MSM_ID'] in ['7600', '7625', '7627']:
   env.Replace(MSM_ID = '76xx')
elif env['MSM_ID'] in ['7x30']:
   env.Replace(MSM_ID = '7x30')
elif env['MSM_ID'] in ['6695']:
   env.Replace(MSM_ID = '6695')
else:
   Return()
# no re-mapping of MSM_ID required for 6695 or 7x30 

#-------------------------------------------------------------------------------
# Publish Private APIs
#-------------------------------------------------------------------------------
env.PublishPrivateApi('BUSES_I2CPD_DAL', [
   '${INC_ROOT}/core/buses/i2c/hal/legacy/inc',
   '${INC_ROOT}/core/buses/i2c/dalpd/legacy/src/common',
   '${INC_ROOT}/core/buses/i2c/dalpd/legacy/src/${MSM_ID}',
])

#-------------------------------------------------------------------------------
# Internal depends within CoreBSP
#-------------------------------------------------------------------------------
CBSP_APIS = [
   'BUSES',
   'DAL',
   'DEBUGTOOLS',
   'HAL',
   'MPROC',
   'POWER',
   'SERVICES',
   'SYSTEMDRIVERS',
   'KERNEL',
]

env.RequirePublicApi(CBSP_APIS)
env.RequireRestrictedApi(CBSP_APIS)

#-------------------------------------------------------------------------------
# Sources, libraries
#-------------------------------------------------------------------------------

DAL_I2CPD_SOURCES = [
   '${BUILDPATH}/src/common/DALI2CPD.c',
   '${BUILDPATH}/src/common/I2cReadSingleByte_BREW.c',
   '${BUILDPATH}/src/common/DALI2CPDFwk.c',
   '${BUILDPATH}/src/${MSM_ID}/DALI2CPDInfo.c'
]

dal_i2cpd_objs = env.Object(DAL_I2CPD_SOURCES)
dal_i2cpd_lib = env.Library('${BUILDPATH}/DALi2cpd', dal_i2cpd_objs)

#-------------------------------------------------------------------------------
# Add Libraries to image
#-------------------------------------------------------------------------------

env.AddLibsToImage(
   ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE', 
   'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'OSBL_BOOT_IMAGE'], 
   dal_i2cpd_lib)
