1
0

create-menu 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  4. systems=$(grep -h config target/*/systems/*|cut -d " " -f 2)
  5. printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.arch
  6. printf "source target/config/Config.in.arch.default\n" >> target/config/Config.in.arch
  7. printf "source target/config/Config.in.arch.choice\n" >> target/config/Config.in.arch
  8. printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.system
  9. printf "source target/config/Config.in.system.default\n" >> target/config/Config.in.system
  10. printf "source target/config/Config.in.system.choice\n" >> target/config/Config.in.system
  11. # update appliances
  12. if [ -d "$topdir/target/appliances" ];then
  13. printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.appliances
  14. printf "choice\n" >> $topdir/target/config/Config.in.appliances
  15. printf "prompt \"Appliance\"\n\n" >> $topdir/target/config/Config.in.appliances
  16. printf "config ADK_CHOOSE_APPLIANCE\n" >> $topdir/target/config/Config.in.appliances
  17. printf "\tprompt \"choose an appliance\"\n" >> $topdir/target/config/Config.in.appliances
  18. printf "\tbool\n\n" >> $topdir/target/config/Config.in.appliances
  19. cat $topdir/target/appliances/*.appliance >> $topdir/target/config/Config.in.appliances 2>/dev/null
  20. printf "\nendchoice\n\n" >> $topdir/target/config/Config.in.appliances
  21. printf "menu \"Appliance Options\"\n" >> $topdir/target/config/Config.in.appliances
  22. printf "\tvisible if !ADK_CHOOSE_APPLIANCE\n" >> $topdir/target/config/Config.in.appliances
  23. cat $topdir/target/appliances/*.options >> $topdir/target/config/Config.in.appliances 2>/dev/null
  24. printf "endmenu\n" >> $topdir/target/config/Config.in.appliances
  25. fi
  26. # create system default
  27. printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.system.default
  28. cat >> $topdir/target/config/Config.in.system.default << EOD
  29. config ADK_TARGET_SYSTEM
  30. string
  31. EOD
  32. for i in $systems;do
  33. system=${i#ADK_TARGET_SYSTEM_}
  34. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  35. system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
  36. system=$(echo $system|sed 's#x86-64#x86_64#')
  37. printf "\tdefault \"${system}\" if $i\n" >> $topdir/target/config/Config.in.system.default
  38. done
  39. # create or update systems
  40. for i in $(ls $topdir/target/);do
  41. if [ -d "$topdir/target/$i/systems" ];then
  42. cat $topdir/target/$i/systems/* > $topdir/target/$i/Config.in.systems 2>/dev/null
  43. fi
  44. done
  45. # create target/$arch/Config.in.arch and target/config/Config.in.system.choice
  46. printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.system.choice
  47. printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.arch.default
  48. for arch in $(cat $topdir/target/arch.lst);do
  49. ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
  50. printf "choice\n" > $topdir/target/$arch/Config.in.arch
  51. printf "prompt \"Embedded system\"\n" >> $topdir/target/$arch/Config.in.arch
  52. printf "depends on ADK_TARGET_ARCH_$ARCH\n" >> $topdir/target/$arch/Config.in.arch
  53. printf "source target/$arch/Config.in.systems\n" >> $topdir/target/$arch/Config.in.arch
  54. printf "endchoice\n" >> $topdir/target/$arch/Config.in.arch
  55. printf "source target/$arch/Config.in.arch\n" >> target/config/Config.in.system.choice
  56. done
  57. cat >> $topdir/target/config/Config.in.arch.default << EOD
  58. config ADK_TARGET_ARCH
  59. string
  60. EOD
  61. for arch in $(cat $topdir/target/arch.lst);do
  62. ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
  63. printf "\tdefault \"$arch\" if ADK_TARGET_ARCH_$ARCH\n" >> target/config/Config.in.arch.default
  64. done
  65. cat > $topdir/target/config/Config.in.arch.choice << EOD
  66. # autogenerated via scripts/create-menu
  67. choice
  68. prompt "Architecture"
  69. EOD
  70. for arch in $(cat $topdir/target/arch.lst);do
  71. ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
  72. printf "config ADK_TARGET_ARCH_$ARCH\n" >> $topdir/target/config/Config.in.arch.choice
  73. printf "\tbool \"$arch system\"\n" >> $topdir/target/config/Config.in.arch.choice
  74. printf "\thelp\n" >> $topdir/target/config/Config.in.arch.choice
  75. printf "\t Support for $ARCH systems.\n\n" >> $topdir/target/config/Config.in.arch.choice
  76. done
  77. printf "endchoice\n" >> $topdir/target/config/Config.in.arch.choice
  78. exit 0