#===============================================================================
#
# HAL CLK LIBRARY
#
# Target:    QSC6695
# Processor: ARM11
#
# GENERAL DESCRIPTION
#    build script
#
# Copyright (c) 2009-2009 by QUALCOMM, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //source/qcom/qct/core/systemdrivers/hal/clk/rel/1.0/build/6695/SConscript#1 $
#  $DateTime: 2011/01/25 16:18:04 $
#  $Author: grahamr $
#  $Change: 1594000 $
#                      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
# --------   ---     ---------------------------------------------------------
#
#===============================================================================

Import('env')
env = env.Clone()

#-----------------------------------------------------------------------------
# Define paths
#-----------------------------------------------------------------------------

SRCPATH = "${BUILD_ROOT}/core/systemdrivers/hal/clk/src"

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


#-------------------------------------------------------------------------------
# Internal depends within CoreBSP
#-------------------------------------------------------------------------------

CBSP_API = [
   'HAL',
   'BOOT',
   'SERVICES',
   'SYSTEMDRIVERS',

   # needs to be last also contains wrong comdef.h
   'KERNEL',
]

env.RequirePublicApi(CBSP_API)
env.RequireRestrictedApi(CBSP_API)

env.PublishPrivateApi("SYSTEMDRIVERS_HAL_CLK", [
  "${INC_ROOT}/core/systemdrivers/hal/clk/inc",
  "${INC_ROOT}/core/systemdrivers/hal/clk/src/common"
])

#-----------------------------------------------------------------------------
# Add extra build flags
#-----------------------------------------------------------------------------

# Need to enable GNU extensions for RVCT to get designated-initializers.
# This causes a bunch of new warnings though, so we suppress those.
if 'RVCT4' in env.get('ARMTOOLS', 'not found'):
  env.Append(CCFLAGS = " --c99")
else:
  env.Append(CCFLAGS = " --gnu --diag_remark 1210,1202")

#-----------------------------------------------------------------------------
# Define source files
#-----------------------------------------------------------------------------

HAL_CLK_SOURCES = [
  '${BUILDPATH}/common/HALclk.c',
  '${BUILDPATH}/6695/HALclk6695ADSP.c',
  '${BUILDPATH}/6695/HALclk6695ADM.c',
  '${BUILDPATH}/6695/HALclk6695ECodec.c',
  '${BUILDPATH}/6695/HALclk6695GP.c',
  '${BUILDPATH}/6695/HALclk6695GSBI.c',
  '${BUILDPATH}/6695/HALclk6695HSIC.c',
  '${BUILDPATH}/6695/HALclk6695I2S.c',
  '${BUILDPATH}/6695/HALclk6695JPEG.c',
  '${BUILDPATH}/6695/HALclk6695Main.c',
  '${BUILDPATH}/6695/HALclk6695MDDI.c',
  '${BUILDPATH}/6695/HALclk6695MDP.c',
  '${BUILDPATH}/6695/HALclk6695MI2S.c',
  '${BUILDPATH}/6695/HALclk6695Misc.c',
  '${BUILDPATH}/6695/HALclk6695MSIM.c',
  '${BUILDPATH}/6695/HALclk6695PLL.c',
  '${BUILDPATH}/6695/HALclk6695SDCC.c',
  '${BUILDPATH}/6695/HALclk6695TV.c',
  '${BUILDPATH}/6695/HALclk6695UART.c',
  '${BUILDPATH}/6695/HALclk6695USB.c',
  '${BUILDPATH}/6695/HALclk6695VFE.c'
]

#-----------------------------------------------------------------------------
# Define objects
#-----------------------------------------------------------------------------

halclk_obj = env.Object(HAL_CLK_SOURCES)
halclk_lib = env.Library('${BUILDPATH}/HALclk', halclk_obj)

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

env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'OSBL_BOOT_IMAGE'], halclk_lib)
