Commit e06a584e by Arnaud Charlet

make.adb (Gnatmake): Do not fail when the main project has no object directory.

	* make.adb (Gnatmake): Do not fail when the main project has no object
	directory.

From-SVN: r94817
parent 5f57ad31
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -4079,12 +4079,10 @@ package body Make is ...@@ -4079,12 +4079,10 @@ package body Make is
if Main_Project /= No_Project then if Main_Project /= No_Project then
if Projects.Table (Main_Project).Object_Directory = No_Name then if Projects.Table (Main_Project).Object_Directory /= No_Name then
Make_Failed ("no sources to compile");
end if;
-- Change the current directory to the object directory of the main -- Change the current directory to the object directory of
-- project. -- the main project.
begin begin
Project_Object_Directory := No_Project; Project_Object_Directory := No_Project;
...@@ -4100,7 +4098,9 @@ package body Make is ...@@ -4100,7 +4098,9 @@ package body Make is
Parent : constant Dir_Name_Str := Parent : constant Dir_Name_Str :=
Dir_Name Dir_Name
(Get_Name_String (Get_Name_String
(Projects.Table (Main_Project).Object_Directory)); (Projects.Table
(Main_Project).Object_Directory));
Dir : Dir_Type; Dir : Dir_Type;
Str : String (1 .. 200); Str : String (1 .. 200);
Last : Natural; Last : Natural;
...@@ -4131,11 +4131,13 @@ package body Make is ...@@ -4131,11 +4131,13 @@ package body Make is
end if; end if;
end; end;
Make_Failed ("unable to change working directory to """, Make_Failed
("unable to change working directory to """,
Get_Name_String Get_Name_String
(Projects.Table (Main_Project).Object_Directory), (Projects.Table (Main_Project).Object_Directory),
""""); """");
end; end;
end if;
-- Source file lookups should be cached for efficiency. -- Source file lookups should be cached for efficiency.
-- Source files are not supposed to change. -- Source files are not supposed to change.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment