samba: update to 4.5.6
[openadk.git] / scripts / create-menu
bloba0dfe2067fa9ef6d3ee497953cf885d637fffdeb
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
14 # update tasks
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
28         string
29 EOD
30 for i in $systems;do
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
36 done
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
47 done
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
52         fi
53 done
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
66 done
68 cat >> $topdir/target/config/Config.in.arch.default << EOD
69 config ADK_TARGET_ARCH
70         string
71 EOD
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
76 done
78 cat > $topdir/target/config/Config.in.arch.choice << EOD
79 # autogenerated via scripts/create-menu
80 choice
81 prompt "Architecture"
83 config ADK_TARGET_CHOOSE_ARCH
84         bool "choose architecture"
86 EOD
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
92         case $arch in
93                 alpha|s390|tile|ppc64|mips64)
94                   printf "\tdepends on ADK_TARGET_OS_LINUX\n" >> $topdir/target/config/Config.in.arch.choice
95                   ;;
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
98                   ;;
99         esac
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
102 done
103 printf "endchoice\n" >> $topdir/target/config/Config.in.arch.choice
104 exit 0