3 # 1. create Config.in.systems with all available target systems for each architecture
4 # 2. if ADK configuration exist, create Config.in.arch/Config.in.system with fixed values
5 # 3. exit when native system build is detected
7 topdir
=$
(readlink
-nf $
(dirname $0)/..
2>/dev
/null ||
(cd $
(dirname $0)/..
; pwd -P))
10 echo 'source "target/config/Config.in.arch.default"' > $topdir/target
/config
/Config.
in.arch
11 echo 'source "target/config/Config.in.arch.choice"' >> $topdir/target
/config
/Config.
in.arch
12 echo 'source "target/config/Config.in.system.default"' > $topdir/target
/config
/Config.
in.system
13 echo 'source "target/config/Config.in.system.choice"' >> $topdir/target
/config
/Config.
in.system
18 native
=$
(grep ^ADK_LINUX_NATIVE
$topdir/.config
)
19 if [ ! -z "$native" ];then
24 touch $topdir/target
/config
/Config.
in.native
26 for i
in $
(ls $topdir/target
/);do
27 if [ -d "$topdir/target/$i/sys-enabled" ];then
28 cat $topdir/target
/$i/sys-enabled
/* > $topdir/target
/$i/Config.
in.systems
2>/dev
/null
31 if [ -f $topdir/.config
];then
35 arch
=$
(grep ^ADK_TARGET_ARCH
$topdir/.config|cut
-f 2 -d = |
sed -e 's#"##g')
36 cpuarch
=$
(grep ^ADK_TARGET_CPU_ARCH
$topdir/.config|cut
-f 2 -d = |
sed -e 's#"##g')
37 systemsym
=$
(grep ^ADK_TARGET_SYSTEM_
$topdir/.config|cut
-f 1 -d =)
38 system
=$
(grep ^ADK_TARGET_SYSTEM
= $topdir/.config|cut
-f 2 -d = |
sed -e 's#"##g')
39 systems
=$
(grep ^ADK_TARGET_SYSTEM
= $topdir/.config|cut
-f 2 -d = |
sed -e 's#"##g'|
sed -e 's#-#_#g')
40 archsym
=$
(echo ADK_LINUX_
$arch|
tr '[:lower:]' '[:upper:]')
42 if [ -z "$arch" -o -z "$system" ];then
46 cat > $topdir/target
/config
/Config.
in.arch
<< EOF
47 source "target/config/Config.in.arch.default"
52 if [ "${system}" = "toolchain" -o "${system}" = "qemu" ];then
53 sys
=${system}-$cpuarch
58 cat > $topdir/target
/config
/Config.
in.system
<< EOF
59 source "target/config/Config.in.system.default"
60 comment "Architecture: $arch"
61 comment "CPU Architecture: $cpuarch"
62 comment "System: $sys"
67 $(grep select $topdir/target/$arch/sys-available/$sys)