Commit 01f81597 authored by Jerome Hugues's avatar Jerome Hugues

* Generate makefile for the root system, and process

          subcomponents correctly

          For issue #61
parent 2b66204e
......@@ -1392,53 +1392,56 @@ package body Ocarina.Backends.Build_Utils is
Fd : File_Descriptor;
begin
-- If the current system is not the root system
-- (e.g. case of a deep hierarchy with systems inside
-- systems, no source has been generated, we exit
-- immediatly,
if not Is_Directory (Get_Name_String (Dir_Name)) then
return;
end if;
-- else, we create the makefile
if Is_Directory (Get_Name_String (Dir_Name)) then
-- We create a makefile iff. the current system is the
-- root system. In the case of ther system, e.g. case
-- of a deep hierarchy with systems inside systems, no
-- source has been generated.
Enter_Directory (Dir_Name);
Enter_Directory (Dir_Name);
Fd := Create_File ("Makefile", Text);
if Fd = Invalid_FD then
raise Program_Error;
end if;
Fd := Create_File ("Makefile", Text);
if Fd = Invalid_FD then
raise Program_Error;
end if;
-- Setting the output
-- Setting the output
Set_Output (Fd);
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 ("SUBDIRS = $(filter-out Makefile, $(wildcard *))");
Write_Eol;
Write_Line ("all:");
Write_Line
(ASCII.HT &
"set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d ; done");
Write_Eol;
Write_Line ("clean:");
Write_Line
(ASCII.HT &
"set -e; for d in $(SUBDIRS); do $(MAKE) " &
"clean -C $$d ; done");
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 ("SUBDIRS = $(filter-out Makefile, $(wildcard *))");
Write_Eol;
Write_Line ("all:");
Write_Line
(ASCII.HT &
"set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d ; done");
Write_Eol;
Write_Line ("clean:");
Write_Line
(ASCII.HT &
"set -e; for d in $(SUBDIRS); do $(MAKE) " &
"clean -C $$d ; done");
-- Close the file
-- Close the file
Close (Fd);
Set_Standard_Output;
Leave_Directory;
Close (Fd);
Set_Standard_Output;
Leave_Directory;
end if;
-- Generate the makefiles of all process subcomponents
......
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