scripts: metadata: add CONFIG_TARGET_SUBTARGET symbol
authorluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 10 May 2016 22:36:13 +0000 (22:36 +0000)
committerluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 10 May 2016 22:36:13 +0000 (22:36 +0000)
Add a new string symbol "CONFIG_TARGET_SUBTARGET" which contains the name of
the chosen subtarget or "generic" if there are no subtargets available.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49323 3c298f89-4303-0410-b956-a3cf2f4a3e73

scripts/metadata.pl

index 99fdba1..6ad3c39 100755 (executable)
@@ -321,6 +321,18 @@ EOF
                $target->{subtarget} or print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
        }
        print <<EOF;
+config TARGET_SUBTARGET
+       string
+       default "generic" if !HAS_SUBTARGETS
+
+EOF
+
+       foreach my $target (@target) {
+               foreach my $subtarget (@{$target->{subtargets}}) {
+                       print "\t\tdefault \"$subtarget\" if TARGET_".$target->{conf}."_$subtarget\n";
+               }
+       }
+       print <<EOF;
 config TARGET_ARCH_PACKAGES
        string