summaryrefslogtreecommitdiff
path: root/gcc/ada/clean.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:34:41 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:34:41 +0000
commit833fb39207d50a1970c50e332349afe7423fde27 (patch)
treed745fc7e6dbcbf297fb6736799c3c03c4e76e002 /gcc/ada/clean.adb
parent05fcfafbdd45eb86c5bec5cb6375c9b493e4dfff (diff)
downloadgcc-833fb39207d50a1970c50e332349afe7423fde27.tar.gz
2005-06-14 Vincent Celier <celier@adacore.com>
* clean.adb (Clean_Project): Correctly delete executable specified as absolute path names. * make.adb (Gnatmake): Allow relative executable path names with directory information even when project files are used. (Change_To_Object_Directory): Fail gracefully when unable to change current working directory to object directory of a project. (Gnatmake): Remove exception handler that could no longer be exercized (Compile_Sources.Compile): Use deep copies of arguments, as some of them may be deallocated by Normalize_Arguments. (Collect_Arguments): Eliminate empty arguments * gnatcmd.adb (All_Projects): New Boolean flag, initialized to False, and set to True when -U is used for GNAT PRETTY or GNAT METRIC. (Check_Project): Return False when Project is No_Project. Return True when All_Projects is True. (GNATCmd): Recognize switch -U for GNAT PRETTY and GNAT METRIC and set All_Projects to True. Minor reformatting git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101028 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/clean.adb')
-rw-r--r--gcc/ada/clean.adb22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb
index 6a53dbae671..4941f916449 100644
--- a/gcc/ada/clean.adb
+++ b/gcc/ada/clean.adb
@@ -884,7 +884,8 @@ package body Clean is
if Project = Main_Project and then Data.Exec_Directory /= No_Name then
declare
Exec_Dir : constant String :=
- Get_Name_String (Data.Exec_Directory);
+ Get_Name_String (Data.Exec_Directory);
+
begin
Change_Dir (Exec_Dir);
@@ -899,9 +900,22 @@ package body Clean is
Main_Source_File,
Current_File_Index);
- if Is_Regular_File (Get_Name_String (Executable)) then
- Delete (Exec_Dir, Get_Name_String (Executable));
- end if;
+ declare
+ Exec_File_Name : constant String :=
+ Get_Name_String (Executable);
+
+ begin
+ if Is_Absolute_Path (Name => Exec_File_Name) then
+ if Is_Regular_File (Exec_File_Name) then
+ Delete ("", Exec_File_Name);
+ end if;
+
+ else
+ if Is_Regular_File (Exec_File_Name) then
+ Delete (Exec_Dir, Exec_File_Name);
+ end if;
+ end if;
+ end;
end if;
if Data.Object_Directory /= No_Name then