Commit 3f4691c1 authored by Maxime Perrotin's avatar Maxime Perrotin

Refactor make process

Use buildsupport.gpr for everything
parent 42d26a97
......@@ -33,15 +33,7 @@ ifeq ($(UNAME), Linux)
fi ; \
fi
endif
mkdir -p tmpBuild
# We have to compile in C99 to support "long long" integers, as imposed by the "aadlinteger" type
# -Wall -Werror -Wextra -Wconversion -Wno-deprecated -Winit-self -Wsign-conversion -Wredundant-decls -Wvla -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wlogical-op -Wmissing-include-dirs -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -Wold-style-cast -Wno-error=old-style-cast -Wsign-promo -Wundef
#clang -c -Wall -Werror -Iinclude c/*.c
$(CC) -c -W -g3 -g -Wall -Werror -Wextra -Werror=format-security -Wconversion -Wno-deprecated -Winit-self -Wsign-conversion -Wredundant-decls -Wvla -Wshadow -Wlogical-op -Wmissing-include-dirs -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -Wno-error=old-style-cast -Wundef -std=c99 -pedantic -Iinclude c/*.c
mv *.o tmpBuild/
#ADA_PROJECT_PATH=`ocarina-config --prefix`/lib/gnat:$$ADA_PROJECT_PATH $(gnatpath)gnatmake -x -g $(exec) -p -P buildsupport.gpr -XBUILD="debug"
ADA_PROJECT_PATH=`ocarina-config --prefix`/lib/gnat:$$ADA_PROJECT_PATH $(gnatpath)gprbuild -x -g $(exec) -p -P buildsupport.gpr -XBUILD="debug"
# strip $(exec)
install:
$(MAKE)
......@@ -49,35 +41,6 @@ install:
cp misc/driveGnuPlotsStreams.pl `ocarina-config --prefix`/bin/
clean:
rm -rf tmpBuild
rm -f $(exec)
rm -f *~
rm -rf tmpBuild $(exec) *~
release: clean
rm -rf tmp/ release/
mkdir release/
mkdir -p tmp/buildsupport-$(VERSION)
mkdir -p tmp/buildsupport-$(VERSION)/c
mkdir -p tmp/buildsupport-$(VERSION)/ada
mkdir -p tmp/buildsupport-$(VERSION)/include
mkdir -p tmp/buildsupport-$(VERSION)/misc
cp -f c/*.c tmp/buildsupport-$(VERSION)/c/
cp -f ada/*.ads tmp/buildsupport-$(VERSION)/ada/
cp -f ada/*.adb tmp/buildsupport-$(VERSION)/ada/
cp -f include/*.h tmp/buildsupport-$(VERSION)/include/
cp -f Makefile tmp/buildsupport-$(VERSION)/
cp -f buildsupport.gpr tmp/buildsupport-$(VERSION)/
cp -f misc/driveGnuPlotsStreams.pl tmp/buildsupport-$(VERSION)/misc/driveGnuPlotsStreams.pl
( cd tmp && tar cvvfz buildsupport-$(VERSION).tar.gz buildsupport-$(VERSION) )
mv tmp/buildsupport-$(VERSION).tar.gz release/
mkdir -p tmp/buildsupport-`uname -m`-$(VERSION)/bin
mkdir -p tmp/buildsupport-`uname -m`-$(VERSION)/misc/
$(MAKE)
cp -f buildsupport tmp/buildsupport-`uname -m`-$(VERSION)/bin
cp -f misc/driveGnuPlotsStreams.pl tmp/buildsupport-`uname -m`-$(VERSION)/misc/
( cd tmp && tar cvvfz buildsupport-`uname -m`-$(VERSION).tgz buildsupport-`uname -m`-$(VERSION)/)
( cp -f tmp/buildsupport-`uname -m`-$(VERSION).tgz release/)
rm -rf tmp/
.PHONY: release
.PHONY: install clean
......@@ -414,14 +414,16 @@ package body Buildsupport_Utils is
CP_ASN1 : constant Node_Id := Corresponding_Instance (Subco);
NA : constant Name_Array := Get_Source_Text (CP_ASN1);
begin
return (Name => US (AIN_Case (Subco)),
Sort => US (Get_Name_String (Get_Type_Source_Name (CP_ASN1))),
Default_Value => US (Get_Name_String (Get_String_Property
(CP_ASN1, "taste::fs_default_value"))),
ASN1_Module => US (Get_ASN1_Module_Name (CP_ASN1)),
ASN1_File_Name => (if NA'Length > 0 then
Just (US (Get_Name_String (NA (1))))
else Nothing));
return Context_Parameter'(
Name => US (AIN_Case (Subco)),
Sort => US (Get_Name_String
(Get_Type_Source_Name (CP_ASN1))),
Default_Value => US (Get_Name_String (Get_String_Property
(CP_ASN1, "taste::fs_default_value"))),
ASN1_Module => US (Get_ASN1_Module_Name (CP_ASN1)),
ASN1_File_Name => (if NA'Length > 0 then
Just (US (Get_Name_String (NA (1))))
else Nothing));
end Parse_CP;
-- Parse a single parameter of an interface
......@@ -435,7 +437,7 @@ package body Buildsupport_Utils is
function Parse_Parameter (Param_I : Node_Id) return ASN1_Parameter is
Asntype : constant Node_Id := Corresponding_Instance (Param_I);
begin
return (
return ASN1_Parameter'(
Name => US (AIN_Case (Param_I)),
Sort => US (Get_Name_String (Get_Type_Source_Name (Asntype))),
ASN1_Module =>
......@@ -544,7 +546,6 @@ package body Buildsupport_Utils is
end if;
PI_Or_RI := AIN.Next_Node (PI_Or_RI);
end loop;
end if;
return Result;
end Parse_Function;
......@@ -583,11 +584,14 @@ package body Buildsupport_Utils is
Exit_On_Error (No (System), "Missing or erroneous interface view");
Current_Function := AIN.First_Node (AIN.Subcomponents (System));
-- Parse functions
while Present (Current_Function) loop
Funcs := Funcs & Rec_Function (Func => Current_Function);
Current_Function := AIN.Next_Node (Current_Function);
end loop;
-- Parse connections
return IV_AST : constant Complete_Interface_View :=
(Flat_Functions => Funcs,
Connections => Routes);
......
......@@ -109,9 +109,9 @@ package Buildsupport_Utils is
package Option_UString is new Option_Type (Unbounded_String);
use Option_UString;
subtype Optional_Unbounded_String is Option_UString.Option;
package Option_Natural is new Option_Type (Unsigned_Long_Long);
use Option_Natural;
subtype Optional_Long_Long is Option_Natural.Option;
package Option_ULL is new Option_Type (Unsigned_Long_Long);
use Option_ULL;
subtype Optional_Long_Long is Option_ULL.Option;
type ASN1_Parameter is
record
......@@ -132,8 +132,8 @@ package Buildsupport_Utils is
Params : Parameters.Vector;
RCM : Supported_RCM_Operation_Kind;
Period_Or_MIAT : Unsigned_Long_Long;
WCET_ms : Optional_Long_Long;
Queue_Size : Optional_Long_Long;
WCET_ms : Optional_Long_Long := Nothing;
Queue_Size : Optional_Long_Long := Nothing;
User_Properties : Property_Maps.Map;
end record;
......@@ -167,10 +167,10 @@ package Buildsupport_Utils is
type Connection is
record
Source_Function : Taste_Terminal_Function;
Dest_Function : Taste_Terminal_Function;
Source_RI : Taste_Interface;
Dest_PI : Taste_Interface;
Source_Function : Unbounded_String;
Dest_Function : Unbounded_String;
Source_RI_Name : Unbounded_String;
Dest_PI_Name : Unbounded_String;
end record;
package Channels is new Indefinite_Vectors (Natural, Connection);
......
......@@ -291,35 +291,4 @@ private
pragma Import (C, C_Set_ASN1_BasicType_OctetString,
"Set_ASN1_BasicType_OctetString");
pragma Linker_Options ("c_backend.o");
pragma Linker_Options ("sdl_gateway.o");
pragma Linker_Options ("build_sdl_glue.o");
pragma Linker_Options ("simulink_gateway.o");
pragma Linker_Options ("concurrency_view.o");
pragma Linker_Options ("vertical_transformation.o");
pragma Linker_Options ("practical_functions.o");
pragma Linker_Options ("build_c_glue.o");
pragma Linker_Options ("build_gui_glue.o");
pragma Linker_Options ("ada_wrappers_backend.o");
pragma Linker_Options ("c_wrappers_backend.o");
pragma Linker_Options ("build_c_skeletons.o");
pragma Linker_Options ("build_ada_skeletons.o");
pragma Linker_Options ("preprocessing_backend.o");
pragma Linker_Options ("semantic_checks.o");
pragma Linker_Options ("build_rtds_glue.o");
pragma Linker_Options ("c_ast_construction.o");
pragma Linker_Options ("build_protected_glue.o");
pragma Linker_Options ("build_script.o");
pragma Linker_Options ("system_config.o");
pragma Linker_Options ("build_scade_skeletons.o");
pragma Linker_Options ("build_vdm_skeletons.o");
pragma Linker_Options ("build_vhdl_skeletons.o");
pragma Linker_Options ("build_rtds_skeletons.o");
pragma Linker_Options ("build_driver_skeletons.o");
pragma Linker_Options ("asn2datamodel.o");
pragma Linker_Options ("context_parameters.o");
pragma Linker_Options ("aadl_cv_unparser.o");
pragma Linker_Options ("driver_configuration.o");
pragma Linker_Options ("taste_directives.o");
pragma Linker_Options ("python_ast_backend.o");
end Imported_Routines;
......@@ -10,13 +10,6 @@ project BuildSupport is
for Main use ("buildsupport.adb");
for Languages use ("Ada", "C");
for Source_Files use ("imported_routines.ads",
"buildsupport.adb",
"buildsupport_utils.ads",
"buildsupport_utils.adb",
"option_type.ads",
"buildsupport_version.ads");
package Builder is
for Default_Switches ("ada") use ("-m");
end Builder;
......@@ -36,7 +29,31 @@ project BuildSupport is
"-gnatg",
"-fstack-check");
for Default_Switches ("C") use ("-g");
for Default_Switches ("C") use
("-g",
"-W",
"-g3",
"-Wall",
"-Werror",
"-Wextra",
"-Werror=format-security",
"-Wconversion",
"-Wno-deprecated",
"-Winit-self",
"-Wsign-conversion",
"-Wredundant-decls",
"-Wvla",
"-Wshadow",
"-Wlogical-op",
"-Wmissing-include-dirs",
"-Winit-self",
"-Wpointer-arith",
"-Wcast-qual",
"-Wcast-align",
"-Wno-error=old-style-cast",
"-Wundef",
"-std=c11",
"-pedantic");
end Compiler;
end BuildSupport;
......
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