allow targets to define a default subtarget when using automatic subtarget detection...
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 4 Jul 2011 11:21:37 +0000 (11:21 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 4 Jul 2011 11:21:37 +0000 (11:21 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27444 3c298f89-4303-0410-b956-a3cf2f4a3e73

include/target.mk
scripts/metadata.pl

index cfd7c9f..af32309 100644 (file)
@@ -215,6 +215,7 @@ define BuildTargets/DumpCurrent
         echo 'Linux-Version: $(LINUX_VERSION)'; \
         echo 'Linux-Release: $(LINUX_RELEASE)'; \
         echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
+       $(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; ))
         echo 'Target-Description:'; \
         $(SH_FUNC) getvar $(call shvar,Target/Description); \
         echo '@@'; \
index 3acdb16..0f4ae9f 100755 (executable)
@@ -56,6 +56,7 @@ sub parse_target_metadata() {
                /^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1;
                /^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1;
                /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
+               /^Default-Subtarget:\s*(.+)\s*$/ and $target->{def_subtarget} = $1;
                /^Default-Packages:\s*(.+)\s*$/ and $target->{packages} = [ split(/\s+/, $1) ];
                /^Target-Profile:\s*(.+)\s*$/ and do {
                        $profile = {
@@ -282,6 +283,14 @@ endchoice
 
 choice
        prompt "Subtarget" if HAS_SUBTARGETS
+EOF
+       foreach my $target (@target) {
+               next unless $target->{def_subtarget};
+               print <<EOF;
+       default TARGET_$target->{conf}_$target->{def_subtarget} if TARGET_$target->{conf}
+EOF
+       }
+       print <<EOF;
 
 EOF
        foreach my $target (@target) {
This page took 0.034488 seconds and 4 git commands to generate.