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
01f81597
Commit
01f81597
authored
Feb 15, 2016
by
Jerome Hugues
Browse files
* Generate makefile for the root system, and process
subcomponents correctly For issue #61
parent
2b66204e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-build_utils.adb
View file @
01f81597
...
...
@@ -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
...
...
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