#!/bin/bash rm ../Makefile 2>/dev/null ln -s ./build/Makefile ../Makefile MANUFACTURER_GROUP=("htzd" "qj" "flx" "spe" "gx" "dt") #print help info. if [ "?" == "$1" ] || [ "" == "$1" ]; then echo "$0 [kl1/2/3] [CHIP/FPGA] [boardburn/chipburn] [version]" echo "example:$0 kl1 CHIP boardburn 11.0.0.1" exit 0 fi # sta and iic build if [ "$1" == "kl2" ]; then export target=kunlun2 export hw_platform_ver=15 export PLATFORM=CHIP elif [ "$1" == "kl3" ]; then export target=kunlun3 if [ "$2" == "" ]; then export PLATFORM=CHIP else export PLATFORM=$2 fi else export target=kunlun export hw_platform_ver=15 export PLATFORM=CHIP fi if [ "$3" == "boardburn" ]; then export ram_build_type=ram_type_boardburn elif [ "$3" == "chipburn" ]; then export ram_build_type=ram_type_chipburn else export ram_build_type=ram_type_smoke fi # In order to prevent compilation errors, the real layout index is determined # at runtime (inherited from the superior compilation script?) export layout_index=1 if [ "$4" == "" ]; then export RAM_VERSION=9.9.9.9 else export RAM_VERSION=$4 fi export disable_print=0 export gcc=riscv export ftm_build=0 export opt_build=1 export flash_build=1 export cpu1_build=0 export mpu_enable=0 export psram_enable=0 export release_build=0 export gdb_debug_enable=1 export product_line=PLC export PATH=/opt/kunlun2/bin/:$PATH set -o errexit if [ ${target} == "kunlun3" ] && [ ${ram_build_type} == "ram_type_chipburn" ]; then MANUFACTURER_GROUP_LENGTH=${#MANUFACTURER_GROUP[*]} else MANUFACTURER_GROUP_LENGTH=1 fi for ((index=0; index < MANUFACTURER_GROUP_LENGTH; index++)); do export manufacturer=${MANUFACTURER_GROUP[index]} echo "manufacturer:${manufacturer}" # clean phy lib etc. make -C .. ram_clean # build klx ram make -C .. ram opt_build=1 done