Commit 724ee382 authored by Maxime Perrotin's avatar Maxime Perrotin

Add support for USER_CFLAGS, USER_LDFLAGS, EXTERNAL_SOURCE_PATH

parent 5ce2e7ed
......@@ -65,6 +65,7 @@ project @_CAPITALIZE:Name_@ is
"../../@_LOWER:Block_Names_@/@_Block_Languages_@/wrappers",
@@END_TABLE@@
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("EXTERNAL_SOURCE_PATH", ":")
& external_as_list("ADA_INCLUDE_PATH", ":");
for Object_Dir use "obj_ada";
......
......@@ -69,12 +69,19 @@ project @_CAPITALIZE:Name_@_AIR is
case Build is
when "Release" =>
for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG");
for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG")
& external_as_list("USER_CFLAGS", " ");
when "Debug" =>
for Default_Switches ("C") use Common_C_Switches & ("-D__PO_HI_USE_VCD=1");
for Default_Switches ("C") use Common_C_Switches & ("-D__PO_HI_USE_VCD=1")
& external_as_list("USER_CFLAGS", " ");
end case;
end Compiler;
package Linker is
for Default_Switches ("C") use
external_as_list("USER_LDFLAGS", " ");
end Linker;
package Builder is
for Executable_Suffix use ".exe";
for Executable ("main.c") use "@_Name_@";
......@@ -103,6 +110,7 @@ project @_CAPITALIZE:Name_@_AIR is
@@END_IF@@
@@END_TABLE@@
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("EXTERNAL_SOURCE_PATH", ":")
& external_as_list("ADA_INCLUDE_PATH", ":");
-- These files are not needed to use POHIC: don' t compile them
......
......@@ -63,6 +63,7 @@ project @_CAPITALIZE:Name_@ is
@@END_IF@@
@@END_TABLE@@
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("EXTERNAL_SOURCE_PATH", ":")
& external_as_list("ADA_INCLUDE_PATH", ":");
for Object_Dir use "obj";
......@@ -137,7 +138,8 @@ project @_CAPITALIZE:Name_@ is
"-Wextra",
"-fdiagnostics-show-option",
"-Wcast-align",
"-Wswitch");
"-Wswitch")
& external_as_list("USER_CFLAGS", " ");
when "Debug" =>
for Default_Switches ("C") use
("-g",
......@@ -149,7 +151,8 @@ project @_CAPITALIZE:Name_@ is
"-Wextra",
"-fdiagnostics-show-option",
"-Wcast-align",
"-Wswitch");
"-Wswitch")
& external_as_list("USER_CFLAGS", " ");
end case;
end Compiler;
......@@ -159,7 +162,8 @@ project @_CAPITALIZE:Name_@ is
"-lrt",
"-lpthread",
"-lm",
"-Wl,-gc-sections");
"-Wl,-gc-sections")
& external_as_list("USER_LDFLAGS", " ");
end Linker;
package Builder is
......
......@@ -67,12 +67,19 @@ project @_CAPITALIZE:Name_@_RTEMS_Ada is
case Build is
when "Release" =>
for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG");
for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG")
& external_as_list("USER_CFLAGS", " ");
when "Debug" =>
for Default_Switches ("C") use Common_C_Switches & ("-D__PO_HI_USE_VCD=1");
for Default_Switches ("C") use Common_C_Switches & ("-D__PO_HI_USE_VCD=1")
& external_as_list("USER_CFLAGS", " ");
end case;
end Compiler;
package Linker is
for Default_Switches ("C") use
external_as_list("USER_LDFLAGS", " ");
end Linker;
package Builder is
for Executable_Suffix use ".exe";
for Executable ("main.c") use "@_Name_@_leon3_rtems";
......@@ -98,6 +105,7 @@ project @_CAPITALIZE:Name_@_RTEMS_Ada is
@@END_IF@@
@@END_TABLE@@
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("EXTERNAL_SOURCE_PATH", ":")
& external_as_list("ADA_INCLUDE_PATH", ":");
-- These files are not needed to use POHIC: don' t compile them
......
KAZOO=../../kazoo
# Add compiler and linker flags
export USER_CFLAGS=
export USER_LDFLAGS=
# you can add folders with source code you want to compile
export EXTERNAL_SOURCE_PATH=
all: c
......
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