===================================================================
@@ -4435,6 +4435,13 @@
declare
Success : Boolean := False;
begin
+ -- If gnatmake was invoked with --subdirs and no project file,
+ -- put the executable in the subdirectory specified.
+
+ if Prj.Subdirs /= null and then Main_Project = No_Project then
+ Change_Dir (Object_Directory_Path.all);
+ end if;
+
Link (Main_ALI_File,
Link_With_Shared_Libgcc.all &
Args (Args'First .. Last_Arg),
@@ -4571,6 +4578,13 @@
end if;
end if;
+ -- If gnatmake was invoked with --subdirs and no project file, put the
+ -- binder generated files in the subdirectory specified.
+
+ if Main_Project = No_Project and then Prj.Subdirs /= null then
+ Change_Dir (Object_Directory_Path.all);
+ end if;
+
begin
Bind (Main_ALI_File,
Bind_Shared.all & Args (Args'First .. Last_Arg));