create-sys 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  3. systems=$(grep -h config target/*/systems/*|cut -d " " -f 2)
  4. echo '' > $topdir/target/config/Config.in.system.default
  5. for j in $systems;do
  6. system=${j#ADK_TARGET_SYSTEM_}
  7. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  8. printf "config ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  9. printf "\tboolean\n\n" >> $topdir/target/config/Config.in.system.default
  10. done
  11. cat >> $topdir/target/config/Config.in.system.default << EOD
  12. config ADK_TARGET_SYSTEM
  13. string
  14. EOD
  15. for i in $systems;do
  16. system=${i#ADK_TARGET_SYSTEM_}
  17. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  18. system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
  19. system=$(echo $system|sed 's#x86-64#x86_64#')
  20. if [ "${system%-*}" = "toolchain" -o "${system%-*}" = "qemu" -o "${system%-*}" = "vbox" -o "${system%-*}" = "aranym" ];then
  21. printf "\tdefault \"${system%-*}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  22. else
  23. printf "\tdefault \"${system}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  24. fi
  25. done
  26. for i in $(ls $topdir/target/);do
  27. if [ -d "$topdir/target/$i/systems" ];then
  28. cat $topdir/target/$i/systems/* > $topdir/target/$i/Config.in.systems 2>/dev/null
  29. fi
  30. done
  31. exit 0