]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ada/makegpr.adb
2004-06-14 Pascal Obry <obry@gnat.com>
[thirdparty/gcc.git] / gcc / ada / makegpr.adb
index 691a6de930de86adc229e13a4fc364e470e5f2ae..5947f19825dc608bfd0f895c842bc29e718514ed 100644 (file)
@@ -2139,7 +2139,9 @@ package body Makegpr is
          Local_Errors := False;
          Data := Projects.Table (Project);
 
-         if not Data.Virtual then
+         --  Nothing to do when no sources of language other than Ada
+
+         if (not Data.Virtual) and then Data.Sources_Present then
 
             --  If the imported directory switches are unknown, compute them
 
@@ -2149,51 +2151,47 @@ package body Makegpr is
                Projects.Table (Project) := Data;
             end if;
 
-            --  Nothing to do when no sources of language other than Ada
+            Need_To_Rebuild_Archive := Force_Compilations;
 
-            if Data.Sources_Present then
-               Need_To_Rebuild_Archive := Force_Compilations;
+            --  Compilation will occur in the object directory
 
-               --  Compilation will occur in the object directory
+            Change_Dir (Get_Name_String (Data.Object_Directory));
 
-               Change_Dir (Get_Name_String (Data.Object_Directory));
+            Source_Id := Data.First_Other_Source;
 
-               Source_Id := Data.First_Other_Source;
+            --  Process each source one by one
 
-               --  Process each source one by one
+            while Source_Id /= No_Other_Source loop
+               Source := Other_Sources.Table (Source_Id);
+               Need_To_Compile := Force_Compilations;
 
-               while Source_Id /= No_Other_Source loop
-                  Source := Other_Sources.Table (Source_Id);
-                  Need_To_Compile := Force_Compilations;
+               --  Check if compilation is needed
 
-                  --  Check if compilation is needed
-
-                  if not Need_To_Compile then
-                     Check_Compilation_Needed (Source, Need_To_Compile);
-                  end if;
+               if not Need_To_Compile then
+                  Check_Compilation_Needed (Source, Need_To_Compile);
+               end if;
 
-                  --  Proceed, if compilation is needed
+               --  Proceed, if compilation is needed
 
-                  if Need_To_Compile then
+               if Need_To_Compile then
 
-                     --  If a source is compiled/recompiled, of course the
-                     --  archive will need to be built/rebuilt.
+                  --  If a source is compiled/recompiled, of course the
+                  --  archive will need to be built/rebuilt.
 
-                     Need_To_Rebuild_Archive := True;
-                     Compile (Source_Id, Data, Local_Errors);
-                  end if;
+                  Need_To_Rebuild_Archive := True;
+                  Compile (Source_Id, Data, Local_Errors);
+               end if;
 
-                  --  Next source, if any
+               --  Next source, if any
 
-                  Source_Id := Source.Next;
-               end loop;
+               Source_Id := Source.Next;
+            end loop;
 
-               --  If there was no compilation error, build/rebuild the archive
-               --  if necessary.
+            --  If there was no compilation error, build/rebuild the archive
+            --  if necessary.
 
-               if not Local_Errors then
-                  Build_Archive (Project, Need_To_Rebuild_Archive);
-               end if;
+            if not Local_Errors then
+               Build_Archive (Project, Need_To_Rebuild_Archive);
             end if;
          end if;
       end loop;