+menu "Target Devices"
+ depends on TARGET_MULTI_PROFILE
+
+ config TARGET_ALL_PROFILES
+ bool "Enable all profiles by default"
+
+ config TARGET_PER_DEVICE_ROOTFS
+ bool "Use a per-device root filesystem that adds profile packages"
+
+EOF
+ foreach my $target (@target) {
+ my $profiles = $target->{profiles};
+ foreach my $profile (@{$target->{profiles}}) {
+ next unless $profile->{id} =~ /^DEVICE_/;
+ print <<EOF;
+menuconfig TARGET_DEVICE_$target->{conf}_$profile->{id}
+ bool "$profile->{name}"
+ depends on TARGET_$target->{conf}
+ default y if TARGET_ALL_PROFILES
+EOF
+ my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
+ foreach my $pkg (@pkglist) {
+ print "\tselect DEFAULT_$pkg if !TARGET_PER_DEVICE_ROOTFS\n";
+ print "\tselect MODULE_DEFAULT_$pkg if TARGET_PER_DEVICE_ROOTFS\n";
+ $defaults{$pkg} = 1;
+ }
+
+ print <<EOF;
+
+
+ config TARGET_DEVICE_PACKAGES_$target->{conf}_$profile->{id}
+ string "$profile->{name} additional packages"
+ default ""
+ depends on TARGET_PER_DEVICE_ROOTFS
+ depends on TARGET_DEVICE_$target->{conf}_$profile->{id}
+
+EOF
+ }
+ }
+
+ print <<EOF;
+
+endmenu
+