#------------------------------------------------------------------------------
#
# \brief	create linker script for specific biwak board
#
#------------------------------------------------------------------------------


set -e
set -u


# board=bigmaster

# board=stm32f4discovery
# app=app_circle

generate()
{
    echo "### Generate map for board ${board} / app ${app}"
    rm -f ${app}_${board} ${app}_${board}_plain

    cpp -DARENA_BOARD=${board} -DARENA_APP=${app} -E symbolmap.h -I../libarena/include -I./ > map/${app}_${board}_plain

    cat map/${app}_${board}_plain | grep -v "^#" > map/${app}_${board}.map || echo Ignore # For the case it is empty
}

j=0

boards="st_discovery_f4 master st_nucleo_f3 st_nucleo_f1 st_nucleo_f0 st_discovery_f4 irclock temprec"
apps="app_circle app_master app_sterm full minimal irclock spi irclock blink temprec"


for board in ${boards}; do
    for app in ${apps}; do
	generate
    done
done

echo "[$0] fin."


#---fin------------------------------------------------------------------------
