Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
c63b580c
Commit
c63b580c
authored
Aug 14, 2013
by
yoogx
Browse files
* Generate top-level Makefiles only in existing directories.
parent
6675d503
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-build_utils.adb
View file @
c63b580c
...
...
@@ -1387,66 +1387,76 @@ 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
-- Create the file
Enter_Directory
(
Normalize_Name
(
Name
(
Identifier
(
E
))));
Fd
:=
Create_File
(
"Makefile"
,
Text
);
if
Is_Directory
(
Get_Name_String
(
Dir_Name
))
then
-- Create the file
Enter_Directory
(
Dir_Name
);
Fd
:=
Create_File
(
"Makefile"
,
Text
);
Write_Eol
;
Write_Eol
;
if
Fd
=
Invalid_FD
then
raise
Program_Error
;
end
if
;
if
Fd
=
Invalid_FD
then
raise
Program_Error
;
end
if
;
-- Setting the output
-- 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
(
"SUBDIRS = "
);
if
not
AAU
.
Is_Empty
(
Subcomponents
(
E
))
then
S
:=
First_Node
(
Subcomponents
(
E
));
while
Present
(
S
)
loop
if
AAU
.
Is_Process
(
Corresponding_Instance
(
S
))
then
Write_Name
(
Normalize_Name
(
Name
(
Identifier
(
S
))));
Write_Str
(
" "
);
-- Corresponding_Instance (S)))));
Set_Output
(
Fd
);
end
if
;
S
:=
Next_Node
(
S
);
end
loop
;
end
if
;
Write_Eol
;
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_Line
(
"all:"
);
Write_Line
(
ASCII
.
HT
&
"set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d ; done"
);
Write_Str
(
"SUBDIRS = "
);
if
not
AAU
.
Is_Empty
(
Subcomponents
(
E
))
then
S
:=
First_Node
(
Subcomponents
(
E
));
Write_Line
(
"clean:"
);
Write_Line
(
ASCII
.
HT
&
" set -e; for d in $(SUBDIRS); do $(MAKE) "
&
"clean -C $$d ; done"
);
while
Present
(
S
)
loop
if
AAU
.
Is_Process
(
Corresponding_Instance
(
S
))
then
Write_Name
(
Normalize_Name
(
Name
(
Identifier
(
S
))));
Write_Str
(
" "
);
-- Corresponding_Instance (S)))));
-- Close the file
end
if
;
S
:=
Next_Node
(
S
)
;
end
loop
;
Close
(
Fd
)
;
Set_Standard_Output
;
Leave_Directory
;
end
if
;
Write_Eol
;
Write_Line
(
"all:"
);
Write_Line
(
ASCII
.
HT
&
"set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d ; done"
);
Write_Line
(
"clean:"
);
Write_Line
(
ASCII
.
HT
&
" set -e; for d in $(SUBDIRS); do $(MAKE) clean -C $$d ; done"
);
-- Close the file
Close
(
Fd
);
Set_Standard_Output
;
Leave_Directory
;
-- Generate the makefiles of all process subcomponents
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment