13 use strict; |
13 use strict; |
14 use usage; |
14 use usage; |
15 use perl_run; |
15 use perl_run; |
16 use File::Spec; |
16 use File::Spec; |
17 use File::Path 'remove_tree'; |
17 use File::Path 'remove_tree'; |
18 use set_epocroot; |
18 use places; |
19 |
19 |
20 usage(\@ARGV,"This script removes all files created by building Raptor"); |
20 usage(\@ARGV,"This script removes all files created by building Raptor"); |
21 my $any_old_targ = File::Spec->catfile("buildtoolguides","romtoolsguide"); |
21 my $any_old_targ = File::Spec->catfile("buildtoolguides","romtoolsguide"); |
22 my $build_log = perl_slurp("build_target.pl $any_old_targ --what 2> ". File::Spec->devnull()); |
22 my $build_log = perl_slurp("build_target.pl $any_old_targ --what 2> ". File::Spec->devnull()); |
23 $build_log =~ /<info>Environment HOSTPLATFORM_DIR=(\S*)<\/info>/; |
23 $build_log =~ /<info>Environment HOSTPLATFORM_DIR=(\S*)<\/info>/; |
24 my $host_platform_dir = $1; |
24 my $host_platform_dir = $1; |
25 die "*** Error: Can't determine HOSTPLATFORM_DIR ***", unless ($host_platform_dir); |
25 die "*** Error: Can't determine HOSTPLATFORM_DIR ***", unless ($host_platform_dir); |
26 set_epocroot(); |
26 my $epocroot = get_epocroot(); |
27 my $epocroot = $ENV{'EPOCROOT'}; |
27 my $abs_host_platform_dir = File::Spec->catfile(get_sbs_home(),"$host_platform_dir"); |
28 my $abs_host_platform_dir = File::Spec->catfile("$epocroot","build","sbsv2","raptor","$host_platform_dir"); |
|
29 if (-d $abs_host_platform_dir) { |
28 if (-d $abs_host_platform_dir) { |
30 print ">>> Clean Raptor\n"; |
29 print ">>> Clean Raptor\n"; |
31 perl_run("clean_raptor.pl") and die $!; |
30 perl_run("clean_raptor.pl") and die $!; |
32 print ">>> Delete the HOSTPLATFORM_DIR\n"; |
31 print ">>> Delete the HOSTPLATFORM_DIR\n"; |
33 print ">>> HOSTPLATFORM_DIR = \"$abs_host_platform_dir\"\n"; |
32 print ">>> HOSTPLATFORM_DIR = \"$abs_host_platform_dir\"\n"; |