Commit 0472e0f3 authored by yoogx's avatar yoogx
Browse files

* Add support for GNATcheck

        For issue openaadl/ocarina#137
parent 46077078
......@@ -101,6 +101,12 @@ $(BUILD_STAMPS): %-build:
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
$(AP_FLAGS);
gnatcheck: %-build:
ADA_PROJECT_PATH=$(top_srcdir)/projects:$(ADA_PROJECT_PATH) \
gnat check -Pocarina-main.gpr -U $(GNATFLAGS) \
-XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)"
clean-local: $(BUILD_DIRS) $(CLEAN_STAMPS) clean-mknodes
# XXX creating/deleting ocarina-configuration.adb is to please
......
......@@ -6,7 +6,7 @@
-- --
-- P r o j e c t --
-- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 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- --
......@@ -50,10 +50,12 @@ project Ocarina.Main is
package Compiler renames Ocarina.Compiler;
package Binder renames Ocarina.Binder;
package Linker renames Ocarina.Linker;
package Check renames Ocarina.Check;
package Builder is
for Executable ("ocarina_cmd.adb") use "ocarina";
for Default_Switches ("Ada") use
Ocarina.Builder'Default_Switches ("Ada");
end Builder;
end Ocarina.Main;
......@@ -6,9 +6,7 @@
-- --
-- P r o j e c t --
-- --
-- Copyright (C) 2009-2012, European Space Agency (ESA). --
-- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 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- --
......@@ -26,8 +24,8 @@
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the Ocarina team --
-- (ocarina-users@listes.enst.fr) --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
......@@ -59,19 +57,19 @@ project Ocarina is
"-fstack-check",
"-gnaty",
"-gnatwL", -- elaboration warnings disabled
"-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses
@GCOV@"-fprofile-arcs",
"-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses
@GCOV@"-fprofile-arcs",
@GCOV@"-ftest-coverage",
"-gnat12");
"-gnat12");
when "release" =>
for Default_Switches ("Ada") use
("-O2",
"-gnat12",
"-gnata",
"-gnaty",
"-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses
"-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses
"-gnatpn");
end case;
end Compiler;
......@@ -79,7 +77,11 @@ project Ocarina is
package Binder is
case Build is
when "debug" =>
for Default_Switches ("Ada") use ("-E", "-t");
for Default_Switches ("Ada") use
("-E", -- Store traceback information in exception occurences
"-r", -- List additional restrictions
"-t" -- Tolerate timestamps and other consistency errors
);
when "release" =>
for Default_Switches ("Ada") use ("-t", "-static");
end case;
......@@ -89,9 +91,9 @@ project Ocarina is
case Build is
when "debug" =>
for Default_Switches ("Ada") use (
@GCOV@"-g",
@GCOV@"-fprofile-arcs",
@GCOV@"-ftest-coverage"
@GCOV@"-g",
@GCOV@"-fprofile-arcs",
@GCOV@"-ftest-coverage"
);
when "release" =>
for Default_Switches ("Ada") use ();
......@@ -106,4 +108,18 @@ project Ocarina is
for Default_Switches ("Ada") use ("-s");
end case;
end Builder;
-----------
-- Check --
-----------
package Check is
for Default_Switches ("ada") use
("-rules",
"+RGoto", -- 9.1.5.11 Goto Statements
"+RMetrics_Cyclomatic_Complexity:7",
"+RMetrics_LSLOC:150"
);
end Check;
end Ocarina;
Supports Markdown
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