Commit 9e002720 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add set of languages for the global makefile template

parent a0e6d223
with Text_IO; use Text_IO;
with Ada.Strings.Unbounded,
Ada.Characters.Handling,
Ada.Containers.Ordered_Sets,
Ada.Exceptions,
Ada.Directories,
TASTE.Parser_Utils;
......@@ -49,21 +50,32 @@ package body TASTE.Backend.Skeletons is
end Function_Makefile;
-- Generate string for a global Makefile (processing all functions)
-- The template contains a set of languages, and a list of
-- combined function name/language
function Global_Makefile return String is
Functions_Tag : Vector_Tag;
Language_Tag : Vector_Tag;
Content_Set : Translate_Set;
package Languages_Set is new Ordered_Sets (Unbounded_String);
use Languages_Set;
Languages : Set;
Unique_Languages : Tag;
Functions_Tag : Vector_Tag;
Language_Tag : Vector_Tag;
Content_Set : Translate_Set;
Tmplt : constant String := Prefix & "makefile.tmplt";
begin
if not Exists (Tmplt) then
raise Skeleton_Error with "Missing makefile.tmplt";
end if;
for each of Model.Interface_View.Flat_Functions loop
for Each of Model.Interface_View.Flat_Functions loop
Languages := Languages or To_Set (US (Language_Spelling (Each)));
Functions_Tag := Functions_Tag & Each.Name;
Language_Tag := Language_Tag & Language_Spelling (Each);
end loop;
Content_Set := +Assoc ("Function_Names", Functions_Tag)
& Assoc ("Language", Language_Tag);
for Each of Languages loop
Unique_Languages := Unique_Languages & To_String (Each);
end loop;
Content_Set := +Assoc ("Function_Names", Functions_Tag)
& Assoc ("Language", Language_Tag)
& Assoc ("Unique_Languages", Unique_Languages);
return Parse (Tmplt, Content_Set);
end Global_Makefile;
......
all:
@@-- The following tags are available in this template:
@@--
@@-- @_Function_Names_@ : Combined table: list of fuction names...
@@-- @_Language_@ : ... and corresponding implementation language
@@-- @_Unique_Languages_@ : List of all languages used in the system
all: @_Unique_Languages_@
@@TABLE@@
@_Function_Names_@ in @_Language_@
@@END_TABLE@@
AADL_PARSER=../../aadl_parser
all: C
Simple_C_Function in C
all: test-parse
test-parse:
$(AADL_PARSER) -i InterfaceView.aadl -d DataView.aadl ../common/TASTE_IV_Properties.aadl
clean:
rm -rf obj $(exec) *~
.PHONY: clean test-parse
Supports Markdown
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