Commit 12575f5e authored by julien.delange's avatar julien.delange

* Generate the Makefile that compile all partitions together

   and pack the final Xtratum binary.



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2359 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 37b2e0e8
......@@ -1010,6 +1010,7 @@ package body Ocarina.Backends.Build_Utils is
procedure Generate_Component_Instance (E : Node_Id);
procedure Generate_System_Instance (E : Node_Id);
procedure Generate_Process_Instance (E : Node_Id);
procedure Generate_Processor_Instance (E : Node_Id);
------------------------------------
-- Generate_Architecture_Instance --
......@@ -1032,6 +1033,9 @@ package body Ocarina.Backends.Build_Utils is
when CC_System =>
Generate_System_Instance (E);
when CC_Processor =>
Generate_Processor_Instance (E);
when CC_Process =>
Generate_Process_Instance (E);
......@@ -1172,6 +1176,121 @@ package body Ocarina.Backends.Build_Utils is
Leave_Directory;
end Generate_Process_Instance;
---------------------------------
-- Generate_Processor_Instance --
---------------------------------
procedure Generate_Processor_Instance (E : Node_Id) is
Fd : File_Descriptor;
S : Node_Id;
The_System : Node_Id;
begin
-- The following part is very specific to PolyORB-HI-C and especially
-- to the code generator for Xtratum. It creates a Makefile to make
-- the final Makefile that integrates all partitions together.
if Get_Current_Backend_Kind /= PolyORB_HI_C then
return;
end if;
if Get_Execution_Platform (E) /= Platform_LEON3_XTRATUM then
return;
end if;
The_System := Parent_Component (Parent_Subcomponent (E));
-- Enter the directories
Enter_Directory
(Normalize_Name
(Display_Name
(Identifier (The_System))));
-- Create the file
Fd := Create_File
("Makefile." &
Get_Name_String
(Normalize_Name
(Display_Name
(Identifier (The_System)))),
Text);
if Fd = Invalid_FD then
raise Program_Error;
end if;
-- Setting the output
Set_Output (Fd);
Write_Line ("###################################################");
Write_Line ("# This Makefile has been generated automatically #");
Write_Line ("# by the Ocarina AADL toolsuite. #");
Write_Line ("# Do not edit this file, all your changes will #");
Write_Line ("# be overridden at the next code generation. #");
Write_Line ("###################################################");
Write_Eol;
Write_Str ("PARTITIONS=");
-- Generate the makefiles of all process subcomponents
if not AAU.Is_Empty (Subcomponents (The_System)) then
S := First_Node (Subcomponents (The_System));
while Present (S) loop
if AAU.Is_Process (Corresponding_Instance (S)) then
Write_Name
(Normalize_Name (Display_Name (Identifier (S))));
Write_Space;
end if;
S := Next_Node (S);
end loop;
end if;
Write_Eol;
Write_Str ("PARTITIONS_BINARIES=");
-- Generate the makefiles of all process subcomponents
if not AAU.Is_Empty (Subcomponents (The_System)) then
S := First_Node (Subcomponents (The_System));
while Present (S) loop
if AAU.Is_Process (Corresponding_Instance (S)) then
Write_Name
(Normalize_Name (Display_Name (Identifier (S))));
Write_Str ("/");
Write_Name
(Normalize_Name (Display_Name (Identifier (S))));
Write_Str (".exe");
Write_Space;
end if;
S := Next_Node (S);
end loop;
end if;
Write_Eol;
Write_Eol;
Write_Str ("include $(RUNTIME_PATH)/make/Makefile.leon3-xtratum");
Write_Eol;
Write_Eol;
Write_Str ("all: resident_sw");
Write_Eol;
Write_Eol;
Close (Fd);
Set_Standard_Output;
-- Leave the directories
Leave_Directory;
end Generate_Processor_Instance;
-- Main part of Generate begins here
begin
......
......@@ -305,18 +305,19 @@ package body Ocarina.Backends.Properties is
Platform_LINUX32_Name : Name_Id;
Platform_LINUX32_Xenomai_Native_Name : Name_Id;
Platform_LINUX32_Xenomai_Posix_Name : Name_Id;
Platform_LINUX64_Name : Name_Id;
Platform_LEON_RTEMS_Name : Name_Id;
Platform_X86_LINUXTASTE_Name : Name_Id;
Platform_X86_RTEMS_Name : Name_Id;
Platform_LEON_GNAT_Name : Name_Id;
Platform_LEON_ORK_Name : Name_Id;
Platform_LEON3_XM3_Name : Name_Id;
Platform_ERC32_ORK_Name : Name_Id;
Platform_ARM_DSLINUX_Name : Name_Id;
Platform_ARM_N770_Name : Name_Id;
Platform_MARTE_OS_Name : Name_Id;
Platform_Vxworks_Name : Name_Id;
Platform_LINUX64_Name : Name_Id;
Platform_LEON_RTEMS_Name : Name_Id;
Platform_X86_LINUXTASTE_Name : Name_Id;
Platform_X86_RTEMS_Name : Name_Id;
Platform_LEON_GNAT_Name : Name_Id;
Platform_LEON_ORK_Name : Name_Id;
Platform_LEON3_XM3_Name : Name_Id;
Platform_LEON3_Xtratum_Name : Name_Id;
Platform_ERC32_ORK_Name : Name_Id;
Platform_ARM_DSLINUX_Name : Name_Id;
Platform_ARM_N770_Name : Name_Id;
Platform_MARTE_OS_Name : Name_Id;
Platform_Vxworks_Name : Name_Id;
Transport_BSD_Sockets_Name : Name_Id;
Transport_SpaceWire_Name : Name_Id;
......@@ -2597,6 +2598,8 @@ package body Ocarina.Backends.Properties is
return Platform_LEON_ORK;
elsif P_Name = Platform_LEON3_XM3_Name then
return Platform_LEON3_XM3;
elsif P_Name = Platform_LEON3_Xtratum_Name then
return Platform_LEON3_XTRATUM;
elsif P_Name = Platform_ERC32_ORK_Name then
return Platform_ERC32_ORK;
elsif P_Name = Platform_ARM_DSLINUX_Name then
......@@ -3132,6 +3135,7 @@ package body Ocarina.Backends.Properties is
Platform_LEON_GNAT_Name := Get_String_Name ("leon_gnat");
Platform_LEON_ORK_Name := Get_String_Name ("leon_ork");
Platform_LEON3_XM3_Name := Get_String_Name ("leon3_xm3");
Platform_LEON3_XTRATUM_Name := Get_String_Name ("leon3_xtratum");
Platform_ERC32_ORK_Name := Get_String_Name ("erc32_ork");
Platform_ARM_DSLINUX_Name := Get_String_Name ("arm_dslinux");
Platform_ARM_N770_Name := Get_String_Name ("arm_n770");
......
......@@ -575,6 +575,7 @@ package Ocarina.Backends.Properties is
Platform_X86_LINUXTASTE,
Platform_LEON_GNAT,
Platform_LEON3_XM3,
Platform_LEON3_XTRATUM,
Platform_LEON_ORK,
Platform_LINUX32,
Platform_LINUX32_XENOMAI_NATIVE,
......
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