aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/target-metadata.pl
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-05-22 22:02:31 +0200
committerFelix Fietkau <nbd@nbd.name>2016-06-07 08:58:40 +0200
commitf8ebbbc568c166e59f1302e0abb817060313fd9d (patch)
treec8b4ee2d13dac0da5023c19e6eb6da4dfb564057 /scripts/target-metadata.pl
parent9ae952cf8cf2f0d7df95434c8b16d13bc1b47fca (diff)
downloadupstream-f8ebbbc568c166e59f1302e0abb817060313fd9d.tar.gz
upstream-f8ebbbc568c166e59f1302e0abb817060313fd9d.tar.bz2
upstream-f8ebbbc568c166e59f1302e0abb817060313fd9d.zip
build: implement support for selecting multiple device profiles
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts/target-metadata.pl')
-rwxr-xr-xscripts/target-metadata.pl46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index 16f8a9f356..34a7c22ce6 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -102,6 +102,9 @@ EOF
if ($target->{arch} =~ /\w/) {
$confstr .= "\tselect $target->{arch}\n";
}
+ if ($target->{has_devices}) {
+ $confstr .= "\tselect HAS_DEVICES\n";
+ }
}
foreach my $dep (@{$target->{depends}}) {
@@ -187,6 +190,21 @@ choice
prompt "Target Profile"
EOF
+ foreach my $target (@target) {
+ my $profile = $target->{profiles}->[0];
+ $profile or next;
+ print <<EOF;
+ default TARGET_$target->{conf}_$profile->{id} if TARGET_$target->{conf}
+EOF
+ }
+
+ print <<EOF;
+
+config TARGET_MULTI_PROFILE
+ bool "Multiple devices"
+ depends on HAS_DEVICES
+
+EOF
foreach my $target (@target) {
my $profiles = $target->{profiles};
@@ -215,9 +233,37 @@ EOF
print <<EOF;
endchoice
+menu "Target Devices"
+ depends on TARGET_MULTI_PROFILE
+
+EOF
+ foreach my $target (@target) {
+ my $profiles = $target->{profiles};
+ foreach my $profile (@{$target->{profiles}}) {
+ next unless $profile->{id} =~ /^DEVICE_/;
+ print <<EOF;
+config TARGET_DEVICE_$target->{conf}_$profile->{id}
+ bool "$profile->{name}"
+ depends on TARGET_$target->{conf}
+EOF
+ my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
+ foreach my $pkg (@pkglist) {
+ print "\tselect DEFAULT_$pkg\n";
+ $defaults{$pkg} = 1;
+ }
+ }
+ }
+
+ print <<EOF;
+
+endmenu
+
config HAS_SUBTARGETS
bool
+config HAS_DEVICES
+ bool
+
config TARGET_BOARD
string