#******************************************************************
#
# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Import('env')
import os

env.AppendUnique(CPPPATH = [
            os.path.join(Dir('.').abspath),
            os.path.join(Dir('.').abspath, 'oic_malloc/include'),
            os.path.join(Dir('.').abspath, 'oic_string/include')
        ])

if env.get('TARGET_OS') == 'tizen':
	env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
else:
	env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource/c_common')])

env.AppendUnique(LIBS = ['c_common'])

common_env = env.Clone()

######################################################################
# Build flags
######################################################################

######################################################################
# Source files and Targets
######################################################################
common_src = [
    'oic_string/src/oic_string.c',
    'oic_malloc/src/oic_malloc.c'
    ]

commonlib = common_env.StaticLibrary('c_common', common_src)
common_env.InstallTarget(commonlib, 'c_common')
common_env.UserInstallTargetLib(commonlib, 'c_common')
