X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=blobdiff_plain;f=scripts%2Fmetadata.pl;h=2fcbf82dfa8ce785b9d2327da95f0e62e36cdddc;hp=fe135418ca1becae3ca613353f061a51bca7f3b3;hb=6db7ad74f61eeaae0c8ecb08d483599d9d80c53f;hpb=ac8f9434660b88d0f9686bed3e0bfd5b0adf1788 diff --git a/scripts/metadata.pl b/scripts/metadata.pl index fe135418c..2fcbf82df 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -23,15 +23,16 @@ sub parse_target_metadata() { while (<>) { chomp; /^Target:\s*(.+)\s*$/ and do { - my $conf = uc $1; - $conf =~ tr/\.-/__/; + my $conf = $1; + $conf =~ tr#/\.\-/#___#; $target = { + id => $1, conf => $conf, - board => $1, profiles => [] }; push @target, $target; }; + /^Target-Board:\s*(.+)\s*$/ and $target->{board} = $1; /^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1; /^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1; /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1; @@ -198,45 +199,6 @@ sub merge_package_lists($$) { return sort(@l); } -sub gen_target_mk() { - my @target = parse_target_metadata(); - - @target = sort { - $a->{board} cmp $b->{board} - } @target; - - foreach my $target (@target) { - my ($profiles_def, $profiles_eval); - - foreach my $profile (@{$target->{profiles}}) { - $profiles_def .= " - define Profile/$target->{conf}\_$profile->{id} - ID:=$profile->{id} - NAME:=$profile->{name} - PACKAGES:=".join(" ", merge_package_lists($target->{packages}, $profile->{packages}))."\n"; - $profile->{kconfig} and $profiles_def .= " KCONFIG:=1\n"; - $profiles_def .= " endef"; - $profiles_eval .= " -\$(eval \$(call AddProfile,$target->{conf}\_$profile->{id}))" - } - print " -ifeq (\$(CONFIG_TARGET_$target->{conf}),y) - define Target - KERNEL:=$target->{kernel} - BOARD:=$target->{board} - BOARDNAME:=$target->{name} - LINUX_VERSION:=$target->{version} - LINUX_RELEASE:=$target->{release} - LINUX_KARCH:=$target->{karch} - DEFAULT_PACKAGES:=".join(" ", @{$target->{packages}})." - endef$profiles_def -endif$profiles_eval - -" - } - print "\$(eval \$(call Target))\n"; -} - sub target_config_features(@) { my $ret; @@ -265,7 +227,7 @@ sub gen_target_config() { print <{board}."\" if TARGET_".$target->{conf}."\n"; + } + print <