aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-nmsc.adb
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2013-10-14 12:47:59 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2013-10-14 14:47:59 +0200
commit3599a97bc3f0b10b87d450a7228cb86edffacabf (patch)
treefd4f007ccf3307a8d3eba23929fc847e666f6caf /gcc/ada/prj-nmsc.adb
parentf7ea2603f6c28fa91fbf2bf5f79cb2d04cec61c7 (diff)
downloadgcc-3599a97bc3f0b10b87d450a7228cb86edffacabf.zip
gcc-3599a97bc3f0b10b87d450a7228cb86edffacabf.tar.gz
gcc-3599a97bc3f0b10b87d450a7228cb86edffacabf.tar.bz2
prj-attr.adb: New attributes in package Clean: Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir.
2013-10-14 Vincent Celier <celier@adacore.com> * prj-attr.adb: New attributes in package Clean: Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir. * prj-nmsc.adb (Process_Clean (Attributes)): New procedure to process attributes Artifacts_In_Exec_Dir and Artifacts_In_Object_Dir in package Clean. * prj.ads (Project_Configuration): New components Artifacts_In_Exec_Dir and Artifacts_In_Object_Dir. * snames.ads-tmpl: New standard names Artifacts_In_Exec_Dir and Artifacts_In_Object_Dir used only by gprclean. From-SVN: r203529
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r--gcc/ada/prj-nmsc.adb53
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index f1538de..12a84e5 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -1127,6 +1127,9 @@ package body Prj.Nmsc is
procedure Process_Builder (Attributes : Variable_Id);
-- Process the simple attributes of package Builder
+ procedure Process_Clean (Attributes : Variable_Id);
+ -- Process the simple attributes of package Clean
+
procedure Process_Clean (Arrays : Array_Id);
-- Process the associated array attributes of package Clean
@@ -1256,6 +1259,55 @@ package body Prj.Nmsc is
-- Process_Clean --
-------------------
+ procedure Process_Clean (Attributes : Variable_Id) is
+ Attribute_Id : Variable_Id;
+ Attribute : Variable;
+ List : String_List_Id;
+
+ begin
+ -- Process non associated array attributes from package Clean
+
+ Attribute_Id := Attributes;
+ while Attribute_Id /= No_Variable loop
+ Attribute := Shared.Variable_Elements.Table (Attribute_Id);
+
+ if not Attribute.Value.Default then
+ if Attribute.Name = Name_Artifacts_In_Exec_Dir then
+
+ -- Attribute Artifacts_In_Exec_Dir: the list of file
+ -- names to be cleaned in the exec dir of the main
+ -- project.
+
+ List := Attribute.Value.Values;
+
+ if List /= Nil_String then
+ Put (Into_List =>
+ Project.Config.Artifacts_In_Exec_Dir,
+ From_List => List,
+ In_Tree => Data.Tree);
+ end if;
+
+ elsif Attribute.Name = Name_Artifacts_In_Object_Dir then
+
+ -- Attribute Artifacts_In_Exec_Dir: the list of file
+ -- names to be cleaned in the object dir of every
+ -- project.
+
+ List := Attribute.Value.Values;
+
+ if List /= Nil_String then
+ Put (Into_List =>
+ Project.Config.Artifacts_In_Object_Dir,
+ From_List => List,
+ In_Tree => Data.Tree);
+ end if;
+ end if;
+ end if;
+
+ Attribute_Id := Attribute.Next;
+ end loop;
+ end Process_Clean;
+
procedure Process_Clean (Arrays : Array_Id) is
Current_Array_Id : Array_Id;
Current_Array : Array_Data;
@@ -1932,6 +1984,7 @@ package body Prj.Nmsc is
-- Process attributes of package Clean
+ Process_Clean (Element.Decl.Attributes);
Process_Clean (Element.Decl.Arrays);
when Name_Compiler =>