cross-plat-dev-utils/reallyclean_all.pl
author Mike Kinghan <mikek@symbian.org>
Thu, 25 Nov 2010 13:59:07 +0000
changeset 40 68f68128601f
parent 2 39c28ec933dd
permissions -rwxr-xr-x
1) Add the sbsv1 components from sftools/dev/build to make the linux_build package independent of the obsolete buildtools package. 2) Enhance romnibus.pl so that it generate the symbol file for the built rom when invoked by Raptor 3) Make the maksym.pl tool portable for Linux as well as Windows. 4) Remove the of armasm2as.pl from the e32tools component in favour of the copy now exported from sbsv1/e32util.

#!/usr/bin/perl
# Copyright (c) 2010 Symbian Foundation Ltd
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Mike Kinghan, mikek@symbian.org, for Symbian Foundation Ltd - initial contribution.

# Script to clean all tools2 targets with Raptor, except Raptor itself
# and any that were broken upstream when last checked.

use strict;
use perl_run;
my $keepgoing = 0;
my @cleaned = ();
my @uncleaned = ();
my @skipped = ();

if (@ARGV) {
    if (grep(/$ARGV[0]/,("-h","--help"))) {
        print "This script really-cleans all TOOLS2 targets with Raptor, " .
			"except Raptor itself and any that were broken upstream when last checked.\n";
        print "Valid arguments are -h, --help; -k, --keepgoing, or none.\n";
		print "-k, --keepgoing makes the script carry on after a failed clean,\n";
		exit 0;  
	} elsif (grep(/$ARGV[0]/,("-k","--keepgoing"))) {
		$keepgoing = 1;
	} else {
	    print "Valid arguments are -h, --help; -k, --keepgoing, or none.\n".
        exit 1;
    }         
}
my @targ_lines = perl_slurp("list_targets.pl");
foreach my $line (@targ_lines) {
	chomp $line;
	next, if ($line =~ /^>>>/);
	if ($line =~ /(\*\*\*.*\*\*\*)/) {
		my $reason = $1;
		my @words = split(/ /,$line);
		print ">>> Skipping target $words[0]: \"$reason\"\n";
		push (@skipped,[$words[0],$reason]);
	} else {
		print ">>> Really-cleaning target $line\n";
		my $rc = perl_run("reallyclean_target.pl $line");
		if ($rc) {
			print "*** $rc ***\n";
			print "*** Failed to really-clean target $line ***\n";
			if ($keepgoing) {
				push(@uncleaned,$line);
			} else {
				exit $rc;
			}
		} else {
			push(@cleaned,$line);
		}
	}
}
if (@cleaned) {
	if (@uncleaned == 0) {
		print ">>> Really-cleaned all eligible targets:-\n";
	} else {
		print ">>> Really-cleaned eligible targets:-\n";
	}
	foreach my $targ (@cleaned) {
		print "+++ $targ\n";
	}
}
if (@uncleaned) {
	print ">>> Failed to really-clean eligible targets:-\n";
	foreach my $targ (@uncleaned) {
		print "+++ $targ\n";
	}
} 
if (@skipped) {
	print ">>> Skipped targets:-\n";
	foreach my $skipped (@skipped) {
		print "+++ " . $skipped->[0] . ' '. $skipped->[1] . "\n";
	}
}   
exit 0;