Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Ocarina
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
Ocarina
Commits
4c6a7248
Commit
4c6a7248
authored
May 10, 2020
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/openaadl/ocarina
parents
23e2cdd5
b983b8f2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
99 additions
and
79 deletions
+99
-79
src/backends/ocarina-backends-build_utils.adb
src/backends/ocarina-backends-build_utils.adb
+45
-50
src/backends/ocarina-backends-execution_tests.ads
src/backends/ocarina-backends-execution_tests.ads
+1
-4
src/backends/ocarina-backends.ads
src/backends/ocarina-backends.ads
+4
-1
src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
+18
-6
src/backends/po_hi_c/ocarina-backends-po_hi_c.adb
src/backends/po_hi_c/ocarina-backends-po_hi_c.adb
+6
-0
src/config/ocarina-configuration.adb.in
src/config/ocarina-configuration.adb.in
+4
-6
src/core/mgmt/ocarina-files.adb
src/core/mgmt/ocarina-files.adb
+12
-1
src/frontends/aadl/ocarina-fe_aadl-parser.adb
src/frontends/aadl/ocarina-fe_aadl-parser.adb
+1
-4
src/main/ocarina_cmd.adb
src/main/ocarina_cmd.adb
+8
-7
No files found.
src/backends/ocarina-backends-build_utils.adb
View file @
4c6a7248
...
...
@@ -191,12 +191,12 @@ package body Ocarina.Backends.Build_Utils is
Normalize_Pathname
(
Name_Buffer
(
1
..
Name_Len
)));
Resolved_Filename
:
constant
String
:=
(
if
Relative_Path
then
Format_Pathname
(
Normalized_Dir
&
"/"
(
if
Relative_Path
then
Format_Pathname
(
Normalized_Dir
&
"/"
&
Get_Name_String
(
Filename
))
else
Normalize_Pathname
(
Get_Name_String
(
Filename
),
Normalized_Dir
));
else
Normalize_Pathname
(
Get_Name_String
(
Filename
),
Normalized_Dir
));
begin
Dirname
:=
Get_String_Name
(
Dir_Name
(
Resolved_Filename
));
...
...
@@ -676,8 +676,12 @@ package body Ocarina.Backends.Build_Utils is
Name_Tables
.
Append
(
M
.
C_Libraries
,
Name_Find
);
elsif
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
=
".c"
then
Get_Name_String
(
Source_Dirname
);
Get_Name_String_And_Append
(
Source_Basename
);
if
Source_Dirname
/=
Get_String_Name
(
"./"
)
then
Get_Name_String
(
Source_Dirname
);
Get_Name_String_And_Append
(
Source_Basename
);
else
Get_Name_String
(
Source_Basename
);
end
if
;
Name_Tables
.
Append
(
M
.
C_Sources
,
Name_Find
);
...
...
@@ -1939,7 +1943,12 @@ package body Ocarina.Backends.Build_Utils is
Set_Str_To_Name_Buffer
(
Base_Name
(
Name_Buffer
(
1
..
Name_Len
)));
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
:=
"o "
;
if
Name_Buffer
(
Name_Len
-
2
..
Name_Len
)
=
"cpp"
then
Name_Buffer
(
Name_Len
-
2
..
Name_Len
)
:=
"o "
;
elsif
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
=
"cc"
then
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
:=
"o "
;
end
if
;
Write_Name
(
Name_Find
);
exit
when
J
=
Name_Tables
.
Last
(
CPP_Sources
);
...
...
@@ -1996,54 +2005,34 @@ package body Ocarina.Backends.Build_Utils is
---------------------
procedure
Compile_C_Files
(
C_Sources
:
Name_Tables
.
Instance
)
is
pragma
Unreferenced
(
C_Sources
);
begin
Write_Line
(
"compile-c-files:"
);
if
Length
(
C_Sources
)
>
0
then
-- Define VPATH, search path for All Prerequisites
for
J
in
Name_Tables
.
First
..
Name_Tables
.
Last
(
C_Sources
)
loop
declare
O_File
:
Name_Id
;
Include_Dir
:
Name_Id
;
begin
Get_Name_String
(
C_Sources
.
Table
(
J
));
Name_Buffer
(
Name_Len
)
:=
'o'
;
Set_Str_To_Name_Buffer
(
Base_Name
(
Name_Buffer
(
1
..
Name_Len
)));
O_File
:=
Name_Find
;
Write_Str
(
"VPATH = ../.."
);
if
Scenario_Dir
/=
null
then
Write_Str
(
":"
&
Scenario_Dir
.
all
);
end
if
;
Write_Eol
;
Write_Eol
;
Get_Name_String
(
C_Sources
.
Table
(
J
));
while
(
Name_Buffer
(
Name_Len
)
/=
Directory_Separator
)
and
then
Name_Len
>
0
loop
Name_Len
:=
Name_Len
-
1
;
end
loop
;
-- Generic rule for compiling C files
if
Name_Len
>
0
then
Set_Str_To_Name_Buffer
(
Name_Buffer
(
1
..
Name_Len
));
Include_Dir
:=
Name_Find
;
else
Include_Dir
:=
No_Name
;
end
if
;
Write_Line
(
"%.o : %.c"
);
Write_Char
(
ASCII
.
HT
);
Write_Str
(
"$(CC) -c $(INCLUDE) $(CFLAGS) "
&
"-I$(RUNTIME_PATH)/include "
);
if
Scenario_Dir
/=
null
then
Write_Str
(
"-I"
&
Scenario_Dir
.
all
&
" "
);
end
if
;
Write_Line
(
" $< -o $@"
);
Write_Eol
;
Write_Char
(
ASCII
.
HT
);
Write_Str
(
"$(CC) -c $(INCLUDE) $(CFLAGS) "
&
"-I$(RUNTIME_PATH)/include "
);
-- compile-c-files rule, simply biuld $(USER_OBJS)
if
Include_Dir
/=
No_Name
then
Write_Str
(
"-I"
);
Write_Str
(
"'"
);
Write_Name
(
Include_Dir
);
Write_Str
(
"'"
);
end
if
;
Write_Line
(
"compile-c-files: $(USER_OBJS) $(C_OBJECTS)"
);
Write_Str
(
" '"
);
Write_Name
(
C_Sources
.
Table
(
J
));
Write_Str
(
"' -o "
);
Write_Name
(
O_File
);
Write_Eol
;
end
;
end
loop
;
end
if
;
end
Compile_C_Files
;
-----------------------
...
...
@@ -2061,7 +2050,13 @@ package body Ocarina.Backends.Build_Utils is
Include_Dir
:
Name_Id
;
begin
Get_Name_String
(
CPP_Sources
.
Table
(
J
));
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
:=
"o "
;
if
Name_Buffer
(
Name_Len
-
2
..
Name_Len
)
=
"cpp"
then
Name_Buffer
(
Name_Len
-
2
..
Name_Len
)
:=
"o "
;
elsif
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
=
"cc"
then
Name_Buffer
(
Name_Len
-
1
..
Name_Len
)
:=
"o "
;
end
if
;
Set_Str_To_Name_Buffer
(
Base_Name
(
Name_Buffer
(
1
..
Name_Len
)));
O_File
:=
Name_Find
;
...
...
src/backends/ocarina-backends-execution_tests.ads
View file @
4c6a7248
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-20
15
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-20
20
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -168,9 +168,6 @@ package Ocarina.Backends.Execution_Tests is
Command_Name_Path
:
String_Ptr
;
-- The command name path
Scenario_Dir
:
String_Ptr
;
-- Path to scenario directory
Create_Referencial
:
Boolean
:=
False
;
-- Decides if we make a regression test or if we write a referencial
-- file
...
...
src/backends/ocarina-backends.ads
View file @
4c6a7248
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-20
18
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-20
20
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -112,6 +112,9 @@ package Ocarina.Backends is
Generated_Sources_Directory
:
Name_Id
:=
No_Name
;
-- Generated code will be in this directory
Scenario_Dir
:
String_Ptr
;
-- Path to scenario directory, required to get source path to user code
Compile_Generated_Sources
:
aliased
Boolean
:=
False
;
Remove_Generated_Sources
:
aliased
Boolean
:=
False
;
Do_Coverage_Test
:
aliased
Boolean
:=
False
;
...
...
src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
View file @
4c6a7248
...
...
@@ -1786,12 +1786,24 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
AAN
.
Destinations
(
F
));
F_N
:
constant
Node_Id
:=
AAN
.
First_Node
(
F_L
);
begin
N
:=
Make_Literal
(
CV
.
New_Pointed_Char_Value
(
Map_C_Enumerator_Name
(
Item
(
F_N
),
Fully_Qualify_Parent
=>
True
)));
if
Present
(
F_N
)
then
N
:=
Make_Literal
(
CV
.
New_Pointed_Char_Value
(
Map_C_Enumerator_Name
(
Item
(
F_N
),
Fully_Qualify_Parent
=>
True
)));
else
-- There is no process port (e.g. thread
-- to thread connection), then we just use
-- the feature name.
N
:=
Make_Literal
(
CV
.
New_Pointed_Char_Value
(
Map_C_Enumerator_Name
(
F
,
Fully_Qualify_Parent
=>
True
)));
end
if
;
Append_Node_To_List
(
N
,
CTN
.
Values
(
Global_Port_Names
));
end
;
...
...
src/backends/po_hi_c/ocarina-backends-po_hi_c.adb
View file @
4c6a7248
...
...
@@ -292,6 +292,12 @@ package body Ocarina.Backends.PO_HI_C is
Write_Line
(
"RUNTIME_PATH=$(BUILD_DIR)/../polyorb-hi-c"
);
Write_Str
(
"USER_SOURCES_DIRS="
);
if
Scenario_Dir
/=
null
then
Write_Space
;
Write_Str
(
"
""
-I"
&
Scenario_Dir
.
all
&
"
""
"
);
end
if
;
if
Length
(
User_Source_Dirs
)
>
0
then
for
J
in
Name_Tables
.
First
..
Name_Tables
.
Last
(
User_Source_Dirs
)
loop
Write_Space
;
...
...
src/config/ocarina-configuration.adb.in
View file @
4c6a7248
...
...
@@ -6,7 +6,7 @@
--
--
--
B
o
d
y
--
--
--
--
Copyright
(
C
)
2006
-
2009
Telecom
ParisTech
,
2010
-
20
16
ESA
&
ISAE
.
--
--
Copyright
(
C
)
2006
-
2009
Telecom
ParisTech
,
2010
-
20
20
ESA
&
ISAE
.
--
--
--
--
Ocarina
is
free
software
;
you
can
redistribute
it
and
/
or
modify
under
--
--
terms
of
the
GNU
General
Public
License
as
published
by
the
Free
Soft
-
--
...
...
@@ -49,7 +49,7 @@ with Ocarina.Parser; use Ocarina.Parser;
--
with
GNAT
.
Compiler_Version
;
with
GNAT
.
OS_Lib
;
use
GNAT
.
OS_Lib
;
--
with
GNAT
.
Source_Info
;
with
GNAT
.
Source_Info
;
with
Ada
.
Command_Line
;
use
Ada
.
Command_Line
;
with
Charset
;
use
Charset
;
...
...
@@ -260,10 +260,8 @@ package body Ocarina.Configuration is
function Ocarina_Last_Configure_Date return String is
begin
return "";
-- XXX The following is disabled, requires GCC 5.x
-- return GNAT.Source_Info.Compilation_Date & " "
-- & GNAT.Source_Info.Compilation_Time;
return GNAT.Source_Info.Compilation_Date & " "
& GNAT.Source_Info.Compilation_Time;
end Ocarina_Last_Configure_Date;
---------------------------------
...
...
src/core/mgmt/ocarina-files.adb
View file @
4c6a7248
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-20
17
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-20
20
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -224,6 +224,17 @@ package body Ocarina.Files is
return
Name_Find
;
end
if
;
end
loop
;
-- Check in default library path last in case the user wants
-- to override some packages.
Get_Name_String
(
Default_Library_Path
);
Add_Char_To_Name_Buffer
(
Directory_Separator
);
Get_Name_String_And_Append
(
Base_File_Name_N
);
if
Is_Regular_File
(
Name_Buffer
(
1
..
Name_Len
))
then
return
Name_Find
;
end
if
;
end
;
return
No_Name
;
...
...
src/frontends/aadl/ocarina-fe_aadl-parser.adb
View file @
4c6a7248
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-20
16
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-20
20
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -40,7 +40,6 @@ with Ocarina.ME_AADL.AADL_Tree.Nodes; use Ocarina.ME_AADL.AADL_Tree.Nodes;
with
Ocarina
.
Files
;
use
Ocarina
.
Files
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
with
Ocarina
.
Options
;
use
Ocarina
.
Options
;
with
Ocarina
.
Parser
;
use
Ocarina
.
Parser
;
with
Ocarina
.
Property_Sets
;
use
Ocarina
.
Property_Sets
;
...
...
@@ -74,8 +73,6 @@ package body Ocarina.FE_AADL.Parser is
procedure
Init
is
begin
First_Parsing
:=
True
;
Add_Library_Path
(
Get_Name_String
(
Default_Library_Path
));
Ocarina
.
Parser
.
Register_Parser
(
Language
,
Process
'
Access
);
end
Init
;
...
...
src/main/ocarina_cmd.adb
View file @
4c6a7248
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2009 Telecom ParisTech, 2010-20
18
ESA & ISAE. --
-- Copyright (C) 2004-2009 Telecom ParisTech, 2010-20
20
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -290,9 +290,6 @@ procedure Ocarina_Cmd is
File_Name
:
constant
String
:=
Image
(
Value
(
N
),
Quoted
=>
False
);
begin
-- Get_Name_String (Current_Scenario_Dirname);
-- Add_Str_To_Name_Buffer (File_Name);
Ocarina
.
Files
.
Add_File_To_Parse_List
(
Get_String_Name
(
File_Name
),
Add_Suffix
=>
True
);
N
:=
Next_Node
(
N
);
...
...
@@ -315,7 +312,6 @@ procedure Ocarina_Cmd is
end
if
;
F
:=
Sources
.
First
;
loop
Dirname
:=
Get_String_Name
...
...
@@ -560,9 +556,10 @@ procedure Ocarina_Cmd is
Ocarina
.
Configuration
.
Reset_Modules
;
Ocarina
.
Reset
;
-- Ocarina.Files.Sources.Init;
Ocarina
.
Initialize
;
Reset_Current_Action
;
Ocarina
.
Cmd_Line
.
Process
;
Language
:=
Get_String_Name
(
"aadl"
);
Ocarina
.
AADL_Version
:=
Temp_AADL_Version
;
Set_Current_Backend_Name
(
The_Backend_Name
);
...
...
@@ -588,6 +585,10 @@ procedure Ocarina_Cmd is
(
Name_Find
,
Add_Suffix
=>
True
);
end
loop
;
-- Add scenario directory to the list of search path
Add_Library_Path
(
Scenario_Dir
.
all
);
-- Avoid memory leaks
Free
(
Result
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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