def build(bld):
    
    toolchain = bld.env["UsedToolchain"]
    if not toolchain:
        bld.fatal('Environment parameter "UsedToolchain" is not available! Make sure to provide the environment parameter "UsedToolchain" in the root wscript file of your project. e.g.: conf.env["UsedToolchain"] = "gccarmemb"')
    
    platform  = bld.env["UsedPlatform"]
    if not platform:
        bld.fatal('Environment parameter "UsedPlatform" is not available! Make sure to provide the environment parameter "UsedPlatform" in the root wscript file of your project. e.g.: conf.env["UsedPlatform"]  = "netx90"')
    
    comp_prefix = bld.get_name_prefix(
        toolchain = toolchain,
        platform  = platform)
        
# Component netx_HostAbstractionLayer -------------------------------------------------------------
    netx_studio_sources = [
        "Sources/netX_hostAbstractionLayer.c", 
        ]
    
    includes = [
        "Includes",
        ]
       
    bld.stlib(
        target          = "netx90_HostAbstractionLayer",
        name            = comp_prefix + "netx90_HostAbstractionLayer",
        description     = "Host abstraction layer for nxhx90-jtag application",
        displaygroup    = "Libraries",
        platform        = platform,
        toolchain       = toolchain,
        use             = [
                           "hostabstractionlayer_sdk",
                           "netx_drv_sdk",
                           "cifXToolkit_sdk",
                          ],
        source          = netx_studio_sources,
        includes        = includes,
        export_includes = includes,
    )
    
    # we need to provide the following sdk component to the netxdrv component. 
    bld.sdkcomponent(
        name            = "netx_drv_configuration_sdk",
        export_includes = includes,
    )
