|
|
@ -10,6 +10,7 @@ use strict; |
|
|
|
|
|
|
|
|
|
|
|
my @target; |
|
|
|
my @target; |
|
|
|
my $target; |
|
|
|
my $target; |
|
|
|
|
|
|
|
my $profile; |
|
|
|
|
|
|
|
|
|
|
|
while (<>) { |
|
|
|
while (<>) { |
|
|
|
chomp; |
|
|
|
chomp; |
|
|
@ -17,18 +18,15 @@ while (<>) { |
|
|
|
$target = { |
|
|
|
$target = { |
|
|
|
id => $1, |
|
|
|
id => $1, |
|
|
|
board => $2, |
|
|
|
board => $2, |
|
|
|
kernel => $3 |
|
|
|
kernel => $3, |
|
|
|
|
|
|
|
profiles => [] |
|
|
|
}; |
|
|
|
}; |
|
|
|
push @target, $target; |
|
|
|
push @target, $target; |
|
|
|
}; |
|
|
|
}; |
|
|
|
/^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1; |
|
|
|
/^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1; |
|
|
|
/^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1; |
|
|
|
/^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1; |
|
|
|
/^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1; |
|
|
|
/^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1; |
|
|
|
/^Target-Features:\s*(.+)\s*$/ and do { |
|
|
|
/^Target-Features:\s*(.+)\s*$/ and $target->{features} = [ split(/\s+/, $1) ]; |
|
|
|
my $f = []; |
|
|
|
|
|
|
|
$target->{features} = $f; |
|
|
|
|
|
|
|
@$f = split /\s+/, $1; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/^Target-Description:/ and do { |
|
|
|
/^Target-Description:/ and do { |
|
|
|
my $desc; |
|
|
|
my $desc; |
|
|
|
while (<>) { |
|
|
|
while (<>) { |
|
|
@ -40,6 +38,17 @@ while (<>) { |
|
|
|
/^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1; |
|
|
|
/^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1; |
|
|
|
/^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1; |
|
|
|
/^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1; |
|
|
|
/^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1; |
|
|
|
/^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1; |
|
|
|
|
|
|
|
/^Default-Packages:\s*(.+)\s*$/ and $target->{packages} = [ split(/\s+/, $1) ]; |
|
|
|
|
|
|
|
/^Target-Profile:\s*(.+)\s*$/ and do { |
|
|
|
|
|
|
|
$profile = { |
|
|
|
|
|
|
|
id => $1, |
|
|
|
|
|
|
|
name => $1, |
|
|
|
|
|
|
|
packages => [] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
push @{$target->{profiles}}, $profile; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1; |
|
|
|
|
|
|
|
/^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@target = sort { |
|
|
|
@target = sort { |
|
|
@ -47,8 +56,20 @@ while (<>) { |
|
|
|
} @target; |
|
|
|
} @target; |
|
|
|
|
|
|
|
|
|
|
|
foreach $target (@target) { |
|
|
|
foreach $target (@target) { |
|
|
|
|
|
|
|
my ($profiles_def, $profiles_eval); |
|
|
|
my $conf = uc $target->{kernel}.'_'.$target->{board}; |
|
|
|
my $conf = uc $target->{kernel}.'_'.$target->{board}; |
|
|
|
$conf =~ tr/\.-/__/; |
|
|
|
$conf =~ tr/\.-/__/; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach my $profile (@{$target->{profiles}}) { |
|
|
|
|
|
|
|
$profiles_def .= " |
|
|
|
|
|
|
|
define Profile/$conf\_$profile->{id} |
|
|
|
|
|
|
|
ID:=$profile->{id} |
|
|
|
|
|
|
|
NAME:=$profile->{name} |
|
|
|
|
|
|
|
PACKAGES:=".join(" ", @{$profile->{packages}})." |
|
|
|
|
|
|
|
endef"; |
|
|
|
|
|
|
|
$profiles_eval .= " |
|
|
|
|
|
|
|
\$(eval \$(call Profile,$conf\_$profile->{id}))" |
|
|
|
|
|
|
|
} |
|
|
|
print <<EOF |
|
|
|
print <<EOF |
|
|
|
ifeq (\$(CONFIG_LINUX_$conf),y) |
|
|
|
ifeq (\$(CONFIG_LINUX_$conf),y) |
|
|
|
define Target |
|
|
|
define Target |
|
|
@ -57,8 +78,8 @@ ifeq (\$(CONFIG_LINUX_$conf),y) |
|
|
|
LINUX_VERSION:=$target->{version} |
|
|
|
LINUX_VERSION:=$target->{version} |
|
|
|
LINUX_RELEASE:=$target->{release} |
|
|
|
LINUX_RELEASE:=$target->{release} |
|
|
|
LINUX_KARCH:=$target->{karch} |
|
|
|
LINUX_KARCH:=$target->{karch} |
|
|
|
endef |
|
|
|
endef$profiles_def |
|
|
|
endif |
|
|
|
endif$profiles_eval |
|
|
|
|
|
|
|
|
|
|
|
EOF |
|
|
|
EOF |
|
|
|
} |
|
|
|
} |
|
|
|