1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
5 systems=$(grep -h config target/*/systems/*|cut -d " " -f 2)
7 printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.arch
8 printf "source target/config/Config.in.arch.default\n" >> target/config/Config.in.arch
9 printf "source target/config/Config.in.arch.choice\n" >> target/config/Config.in.arch
10 printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.system
11 printf "source target/config/Config.in.system.default\n" >> target/config/Config.in.system
12 printf "source target/config/Config.in.system.choice\n" >> target/config/Config.in.system
15 if [ -d "$topdir/tasks" ];then
16 printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.tasks
17 printf "menu \"Tasks\"\n" >> $topdir/target/config/Config.in.tasks
18 printf "\tvisible if ADK_TARGET_OS_LINUX && !ADK_TARGET_CHOOSE_ARCH\n\n" >> $topdir/target/config/Config.in.tasks
19 cat $topdir/tasks/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
20 printf "\nendmenu\n\n" >> $topdir/target/config/Config.in.tasks
23 # create system default
24 printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.system.default
26 cat >> $topdir/target/config/Config.in.system.default << EOD
27 config ADK_TARGET_SYSTEM
31 system=${i#ADK_TARGET_SYSTEM_}
32 systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
33 system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
34 system=$(echo $system|sed 's#x86-64#x86_64#')
35 printf "\tdefault \"${system}\" if $i\n" >> $topdir/target/config/Config.in.system.default
38 # create or update systems
39 for arch in $(cat $topdir/target/arch.lst);do
40 ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
41 printf "config ADK_TARGET_SYSTEM_GENERIC_$ARCH\n" > $topdir/target/$arch/Config.in.systems
42 printf "\tbool \"Generic\"\n" >> $topdir/target/$arch/Config.in.systems
43 printf "\tselect ADK_TARGET_GENERIC\n" >> $topdir/target/$arch/Config.in.systems
44 printf "\thelp\n" >> $topdir/target/$arch/Config.in.systems
45 printf "\t Generic $ARCH system.\n\n" >> $topdir/target/$arch/Config.in.systems
46 printf "\tdefault \"generic-${arch}\" if ADK_TARGET_SYSTEM_GENERIC_$ARCH\n" >> $topdir/target/config/Config.in.system.default
49 for i in $(ls $topdir/target/);do
50 if [ -d "$topdir/target/$i/systems" ];then
51 cat $topdir/target/$i/systems/* >> $topdir/target/$i/Config.in.systems 2>/dev/null
55 # create target/$arch/Config.in.arch and target/config/Config.in.system.choice
56 printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.system.choice
57 printf "# autogenerated via scripts/create-menu\n" > target/config/Config.in.arch.default
58 for arch in $(cat $topdir/target/arch.lst);do
59 ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
60 printf "choice\n" > $topdir/target/$arch/Config.in.arch
61 printf "prompt \"System\"\n" >> $topdir/target/$arch/Config.in.arch
62 printf "depends on ADK_TARGET_ARCH_$ARCH\n" >> $topdir/target/$arch/Config.in.arch
63 printf "source target/$arch/Config.in.systems\n" >> $topdir/target/$arch/Config.in.arch
64 printf "endchoice\n" >> $topdir/target/$arch/Config.in.arch
65 printf "source target/$arch/Config.in.arch\n" >> target/config/Config.in.system.choice
68 cat >> $topdir/target/config/Config.in.arch.default << EOD
69 config ADK_TARGET_ARCH
73 for arch in $(cat $topdir/target/arch.lst);do
74 ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
75 printf "\tdefault \"$arch\" if ADK_TARGET_ARCH_$ARCH\n" >> target/config/Config.in.arch.default
78 cat > $topdir/target/config/Config.in.arch.choice << EOD
79 # autogenerated via scripts/create-menu
83 config ADK_TARGET_CHOOSE_ARCH
84 bool "choose architecture"
88 for arch in $(cat $topdir/target/arch.lst);do
89 ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]')
90 printf "config ADK_TARGET_ARCH_$ARCH\n" >> $topdir/target/config/Config.in.arch.choice
91 printf "\tbool \"$arch\"\n" >> $topdir/target/config/Config.in.arch.choice
93 alpha|s390|tile|ppc64|mips64)
94 printf "\tdepends on ADK_TARGET_OS_LINUX\n" >> $topdir/target/config/Config.in.arch.choice
96 cr16|epiphany|m32r|mn10300|moxie|msp430|rx|v850)
97 printf "\tdepends on ADK_TARGET_OS_BAREMETAL\n" >> $topdir/target/config/Config.in.arch.choice
100 printf "\thelp\n" >> $topdir/target/config/Config.in.arch.choice
101 printf "\t Support for $ARCH systems.\n\n" >> $topdir/target/config/Config.in.arch.choice
103 printf "endchoice\n" >> $topdir/target/config/Config.in.arch.choice