#===================================================================================================
#                         THIS INFORMATION IS PROPRIETARY TO BROADCOM CORP
#---------------------------------------------------------------------------------------------------
#                                Copyright (c) 2018 Broadcom Corp.
#                                       ALL RIGHTS RESERVED
#===================================================================================================
#===================================================================================================
#! \file
#!
#! Root-level makefile of DSP SDK.
#
#===================================================================================================


#---------------------------------------------------------------------------------------------------
# From environment
#---------------------------------------------------------------------------------------------------
ifndef XTENSA_TOOLS_ROOT
$(error must define XTENSA_TOOLS_ROOT)
endif
ifndef XTENSA_CORE
$(error must define XTENSA_CORE)
endif

.SUFFIXES:
.SUFFIXES: .a .o .c .cc .C .cpp .s .S .h

#---------------------------------------------------------------------------------------------------
# Set up the tools environment
#---------------------------------------------------------------------------------------------------
#
include common.inc


#---------------------------------------------------------------------------------------------------
# Targets
#---------------------------------------------------------------------------------------------------


CHIP_NUMBER = 43014
BASELINE_VER = 0x00000000        # Default version, if none specified in command-line   

BLD_DIR_COMMON = common_image
TARGET_COMMON = common.elf
BLD_DIR_AU = audio_image
TARGET_AU = audio.elf
BLD_DIR_SP = speech_image
TARGET_SP = speech.elf

OUTPUTDIR = _sdk_output

default: all

all: $(BLD_DIR_COMMON)/$(TARGET_COMMON) $(BLD_DIR_AU)/$(TARGET_AU) $(BLD_DIR_SP)/$(TARGET_SP)

clean:
	@$(call remove_dir_silent,$(BLD_DIR_COMMON))
	@$(call print,"removed directory $(BLD_DIR_COMMON)")
	@$(call remove_dir_silent,$(BLD_DIR_AU))
	@$(call print,"removed directory $(BLD_DIR_AU)")
	@$(call remove_dir_silent,$(BLD_DIR_SP))
	@$(call print,"removed directory $(BLD_DIR_SP)")
	@$(call remove_dir_silent,$(OUTPUTDIR))
	@$(call print,"removed directory $(OUTPUTDIR)")


include sdk_rules.inc

.PHONY: clean help
#---------------------------------------------------------------------------------------------------
# Dependencies - these must follow the generic rules
#---------------------------------------------------------------------------------------------------

-include $(D_FILES)
