123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
- systems=$(grep -h config target/*/systems/*|cut -d " " -f 2)
- printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.arch
- printf "source target/config/Config.in.arch.default\n" >> target/config/Config.in.arch
- printf "source target/config/Config.in.arch.choice\n" >> target/config/Config.in.arch
- printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.system
- printf "source target/config/Config.in.system.default\n" >> target/config/Config.in.system
- printf "source target/config/Config.in.system.choice\n" >> target/config/Config.in.system
- if [ -d "$topdir/tasks" ];then
- printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.tasks
- printf "menu \"Tasks\"\n" >> $topdir/target/config/Config.in.tasks
- printf "\tvisible if ADK_TARGET_OS_LINUX && !ADK_TARGET_CHOOSE_ARCH\n\n" >> $topdir/target/config/Config.in.tasks
- cat $topdir/tasks/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
- printf "\nendmenu\n\n" >> $topdir/target/config/Config.in.tasks
- fi
- printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.system.default
- cat >> $topdir/target/config/Config.in.system.default << EOD
- config ADK_TARGET_SYSTEM
- string
- EOD
- for i in $systems;do
- system=${i#ADK_TARGET_SYSTEM_}
- systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
- system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
- system=$(echo $system|sed 's#x86-64#x86_64#')
- printf "\tdefault \"${system}\" if $i\n" >> $topdir/target/config/Config.in.system.default
- done
- for arch in $(cat $topdir/target/arch.lst);do
- ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
- printf "config ADK_TARGET_SYSTEM_GENERIC_$ARCH\n" > $topdir/target/$arch/Config.in.systems
- printf "\tbool \"Generic\"\n" >> $topdir/target/$arch/Config.in.systems
- printf "\tselect ADK_TARGET_GENERIC\n" >> $topdir/target/$arch/Config.in.systems
- printf "\thelp\n" >> $topdir/target/$arch/Config.in.systems
- printf "\t Generic $ARCH system.\n\n" >> $topdir/target/$arch/Config.in.systems
- printf "\tdefault \"generic-${arch}\" if ADK_TARGET_SYSTEM_GENERIC_$ARCH\n" >> $topdir/target/config/Config.in.system.default
- done
- for i in $(ls $topdir/target/);do
- if [ -d "$topdir/target/$i/systems" ];then
- cat $topdir/target/$i/systems/* >> $topdir/target/$i/Config.in.systems 2>/dev/null
- fi
- done
- printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.system.choice
- printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.arch.default
- for arch in $(cat $topdir/target/arch.lst);do
- ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
- printf "choice\n" > $topdir/target/$arch/Config.in.arch
- printf "prompt \"System\"\n" >> $topdir/target/$arch/Config.in.arch
- printf "depends on ADK_TARGET_ARCH_$ARCH\n" >> $topdir/target/$arch/Config.in.arch
- printf "source target/$arch/Config.in.systems\n" >> $topdir/target/$arch/Config.in.arch
- printf "endchoice\n" >> $topdir/target/$arch/Config.in.arch
- printf "source target/$arch/Config.in.arch\n" >> target/config/Config.in.system.choice
- done
- cat >> $topdir/target/config/Config.in.arch.default << EOD
- config ADK_TARGET_ARCH
- string
- EOD
- for arch in $(cat $topdir/target/arch.lst);do
- ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
- printf "\tdefault \"$arch\" if ADK_TARGET_ARCH_$ARCH\n" >> target/config/Config.in.arch.default
- done
- cat > $topdir/target/config/Config.in.arch.choice << EOD
- choice
- prompt "Architecture"
- config ADK_TARGET_CHOOSE_ARCH
- bool "choose architecture"
- EOD
- for arch in $(cat $topdir/target/arch.lst);do
- ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
- printf "config ADK_TARGET_ARCH_$ARCH\n" >> $topdir/target/config/Config.in.arch.choice
- printf "\tbool \"$arch\"\n" >> $topdir/target/config/Config.in.arch.choice
- case $arch in
- alpha|s390|tile|ppc64|mips64)
- printf "\tdepends on ADK_TARGET_OS_LINUX\n" >> $topdir/target/config/Config.in.arch.choice
- ;;
- cr16|epiphany|m32c|m32r|mn10300|moxie|msp430|rx|v850)
- printf "\tdepends on ADK_TARGET_OS_BAREMETAL\n" >> $topdir/target/config/Config.in.arch.choice
- ;;
- esac
- printf "\thelp\n" >> $topdir/target/config/Config.in.arch.choice
- printf "\t Support for $ARCH systems.\n\n" >> $topdir/target/config/Config.in.arch.choice
- done
- printf "endchoice\n" >> $topdir/target/config/Config.in.arch.choice
- exit 0
|