diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 13:54:58 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 13:54:58 +0000 |
commit | cb319195d806e587c1508b01a23f8d410c7c4803 (patch) | |
tree | 78448b142bdc5bc8be19352cf2033b0be2151249 /gcc/ada/make.adb | |
parent | d7f9727a15ecf7c7a4d5c26f4cb26ed40a5688a9 (diff) | |
download | gcc-cb319195d806e587c1508b01a23f8d410c7c4803.tar.gz |
* make.adb (Gnatmake): Do not fail when the main project has no object
directory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94817 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r-- | gcc/ada/make.adb | 94 |
1 files changed, 48 insertions, 46 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index eb57773fe89..e799e05d8da 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -4079,63 +4079,65 @@ package body Make is if Main_Project /= No_Project then - if Projects.Table (Main_Project).Object_Directory = No_Name then - Make_Failed ("no sources to compile"); - end if; + if Projects.Table (Main_Project).Object_Directory /= No_Name then - -- Change the current directory to the object directory of the main - -- project. + -- Change the current directory to the object directory of + -- the main project. - begin - Project_Object_Directory := No_Project; - Change_To_Object_Directory (Main_Project); + begin + Project_Object_Directory := No_Project; + Change_To_Object_Directory (Main_Project); - exception - when Directory_Error => + exception + when Directory_Error => - -- This should never happen. But, if it does, display the - -- content of the parent directory of the obj dir. + -- This should never happen. But, if it does, display the + -- content of the parent directory of the obj dir. - declare - Parent : constant Dir_Name_Str := - Dir_Name - (Get_Name_String - (Projects.Table (Main_Project).Object_Directory)); - Dir : Dir_Type; - Str : String (1 .. 200); - Last : Natural; + declare + Parent : constant Dir_Name_Str := + Dir_Name + (Get_Name_String + (Projects.Table + (Main_Project).Object_Directory)); - begin - Write_Str ("Contents of directory """); - Write_Str (Parent); - Write_Line (""":"); + Dir : Dir_Type; + Str : String (1 .. 200); + Last : Natural; - Open (Dir, Parent); + begin + Write_Str ("Contents of directory """); + Write_Str (Parent); + Write_Line (""":"); - loop - Read (Dir, Str, Last); - exit when Last = 0; - Write_Str (" "); - Write_Line (Str (1 .. Last)); - end loop; + Open (Dir, Parent); - Close (Dir); + loop + Read (Dir, Str, Last); + exit when Last = 0; + Write_Str (" "); + Write_Line (Str (1 .. Last)); + end loop; - exception - when X : others => - Write_Line ("(unexpected exception)"); - Write_Line (Exception_Information (X)); + Close (Dir); - if Is_Open (Dir) then - Close (Dir); - end if; - end; + exception + when X : others => + Write_Line ("(unexpected exception)"); + Write_Line (Exception_Information (X)); - Make_Failed ("unable to change working directory to """, - Get_Name_String - (Projects.Table (Main_Project).Object_Directory), - """"); - end; + if Is_Open (Dir) then + Close (Dir); + end if; + end; + + Make_Failed + ("unable to change working directory to """, + Get_Name_String + (Projects.Table (Main_Project).Object_Directory), + """"); + end; + end if; -- Source file lookups should be cached for efficiency. -- Source files are not supposed to change. |