Commit c63b580c authored by yoogx's avatar yoogx

* Generate top-level Makefiles only in existing directories.

parent 6675d503
......@@ -1387,11 +1387,16 @@ package body Ocarina.Backends.Build_Utils is
------------------------------
procedure Generate_System_Instance (E : Node_Id) is
Dir_Name : constant Name_Id
:= Normalize_Name (Name (Identifier (E)));
S : Node_Id;
Fd : File_Descriptor;
begin
if Is_Directory (Get_Name_String (Dir_Name)) then
-- Create the file
Enter_Directory (Normalize_Name (Name (Identifier (E))));
Enter_Directory (Dir_Name);
Fd := Create_File ("Makefile", Text);
Write_Eol;
......@@ -1404,12 +1409,18 @@ package body Ocarina.Backends.Build_Utils is
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_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 = ");
......@@ -1437,16 +1448,15 @@ package body Ocarina.Backends.Build_Utils is
Write_Line ("clean:");
Write_Line
(ASCII.HT
&
" set -e; for d in $(SUBDIRS); do $(MAKE) clean -C $$d ; done"
);
(ASCII.HT & " set -e; for d in $(SUBDIRS); do $(MAKE) "
& "clean -C $$d ; done");
-- Close the file
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