Commit 3b908f5d authored by yoogx's avatar yoogx

* Reorganize Python subpart

parent ec7ce83b
......@@ -410,11 +410,13 @@ AC_OUTPUT([
resources/runtime/aadl_xml/Makefile
projects/ocarina.gpr
src/main/Makefile
src/main/ocarina-configuration.adb
src/config/ocarina-configuration.adb
src/frontends/Makefile
src/config/Makefile
src/core/Makefile
src/transfo/Makefile
src/backends/Makefile
src/python/Makefile
src/Makefile
support/Makefile
support/strip_wrapper.sh
......
......@@ -36,6 +36,7 @@ OBJECT_DIRS = $(top_builddir)/src/core/objects \
$(top_builddir)/src/backends/objects \
$(top_builddir)/src/transfo/objects \
$(top_builddir)/src/main/objects \
$(top_builddir)/src/python/objects \
$(top_builddir)/src/config/objects
# Library directories (*.ali, *.a)
......@@ -45,6 +46,7 @@ LIB_DIRS = $(top_builddir)/src/core/libs \
$(top_builddir)/src/backends/libs \
$(top_builddir)/src/transfo/libs \
$(top_builddir)/src/config/libs \
$(top_builddir)/src/python/libs \
$(top_builddir)/src/main/libs
# All directories used for the build process. If the configure is
......
......@@ -38,13 +38,12 @@ with "ocarina-backends";
with "ocarina-transfo";
project Ocarina.Config is
Src_Dir := Ocarina.Top_Src_Dir & "/main";
Src_Dir_2 := Ocarina.Top_Build_Dir & "/main";
Src_Dir := Ocarina.Top_Src_Dir & "/config";
Build_Dir := Ocarina.Top_Build_Dir & "/config";
for Source_Dirs use (Src_Dir, Src_Dir_2, Build_Dir);
for Source_Files use ("ocarina-configuration.adb", "ocarina-configuration.ads");
for Source_Dirs use (Src_Dir, Build_Dir);
for Object_Dir use Build_Dir & "/objects";
for Library_Dir use Build_Dir & "/libs";
for Library_Name use "ocarina-config";
for Library_Kind use Ocarina.Lib_Type;
......
......@@ -33,16 +33,17 @@
with "ocarina";
with "ocarina-core";
with "ocarina-config";
with "ocarina-frontends";
with "ocarina-backends";
with "ocarina-transfo";
with "gnatcoll_python";
project Ocarina.Main is
Src_Dir := Ocarina.Top_Src_Dir & "/main";
Src_Dir_2 := Ocarina.Top_Src_Dir & "/python";
Build_Dir := Ocarina.Top_Build_Dir & "/main";
for Source_Dirs use (Src_Dir, Build_Dir);
for Source_Dirs use (Src_Dir, Build_Dir, src_dir_2);
for Object_Dir use Build_Dir & "/objects";
for Library_Dir use Build_Dir & "/libs";
for Exec_Dir use Build_Dir;
......@@ -51,6 +52,7 @@ project Ocarina.Main is
package Compiler renames Ocarina.Compiler;
package Binder renames Ocarina.Binder;
package Linker renames Ocarina.Linker;
package Builder is
for Executable ("ocarina_cmd") use "ocarina";
for Default_Switches ("Ada") use
......
......@@ -32,25 +32,33 @@
------------------------------------------------------------------------------
with "ocarina";
with "ocarina-config";
with "ocarina-core";
with "ocarina-frontends";
with "ocarina-backends";
with "ocarina-transfo";
with "gnatcoll_python";
project Ocarina.Python is
Src_Dir := Ocarina.Top_Src_Dir & "/main";
Build_Dir := Ocarina.Top_Build_Dir & "/main";
Src_Dir := Ocarina.Top_Src_Dir & "/python";
Build_Dir := Ocarina.Top_Build_Dir & "/python";
for Source_Dirs use (Src_Dir, Build_Dir);
for Object_Dir use Build_Dir & "/objects";
for Library_Dir use Build_Dir & "/libs";
for Library_Name use "ocarina-python";
for Library_Name use "ocarina_python";
for Library_Kind use Ocarina.Lib_Type;
for Library_Version use "libocarina_python.so";
for Library_Interface use ("ocarina.python_cmd");
for Library_Standalone use "standard";
-- for Library_Standalone use "encapsulated";
package Compiler renames Ocarina.Compiler;
package Binder renames Ocarina.Binder;
package Builder renames Ocarina.Builder;
package Binder renames Ocarina.Binder;
package Builder renames Ocarina.Builder;
end Ocarina.Python;
......@@ -59,6 +59,7 @@ project Ocarina is
"-gnatoa",
"-fstack-check",
"-gnaty",
"-gnatwl",
"-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses
@GCOV@"-fprofile-arcs",
......@@ -80,7 +81,7 @@ project Ocarina is
package Binder is
case Build is
when "debug" =>
for Default_Switches ("Ada") use ("-E", "-t", "-static");
for Default_Switches ("Ada") use ("-E", "-t");
when "release" =>
for Default_Switches ("Ada") use ("-t", "-static");
end case;
......
SUBDIRS = core frontends backends main transfo
SUBDIRS = core frontends backends main transfo python config
......@@ -69,7 +69,7 @@ with Ocarina.FE_AADL.Parser; use Ocarina.FE_AADL.Parser;
with Ocarina.ME_REAL.Tokens;
with Ocarina.Scripts; use Ocarina.Scripts;
with Ocarina.Utils; use Ocarina.Utils;
with Ocarina.Python; use Ocarina.Python;
-- with Ocarina.Python; use Ocarina.Python;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
procedure Ocarina_Cmd is
......@@ -867,7 +867,7 @@ begin
OS_Exit (0);
when Python_Shell =>
Run_Python;
-- Run_Python;
OS_Exit (0);
when Parse_Scenario_Files_First =>
......
......@@ -111,7 +111,9 @@ package body Ocarina.Python_Cmd is
-- register those you intend to support
Repo := new Scripts_Repository_Record;
Register_Python_Scripting (Repo, "ocarina");
Register_Python_Scripting (Repo, "libocarina_python");
-- Note: it must match the name of the library generated
Register_Standard_Classes (Repo, "Console");
-- Register our custom functions
......@@ -152,7 +154,7 @@ package body Ocarina.Python_Cmd is
procedure Initialize_Lib is
procedure Adainit;
pragma Import (C, Adainit, "adainit");
pragma Import (C, Adainit, "ocarina_pythoninit");
begin
-- Initialize Ada runtime
......@@ -166,6 +168,7 @@ package body Ocarina.Python_Cmd is
-- Initialize Python bindings
Repo := Register_Scripts_And_Functions;
end Initialize_Lib;
----------------
......
......@@ -11,7 +11,7 @@ package Ocarina.Python_Cmd is
-- export
procedure Initialize_Lib;
pragma Export (C, Initialize_Lib, "initocarina");
pragma Export (C, Initialize_Lib, "initlibocarina_python");
procedure Initialize;
......
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