mk/genlink: change devices.data format to remove gcc specific options

As discussed with karlp on irc the devices.data file should not contain
gcc specific command line options.

For that reason the command line options for gcc are now generated from
the variables CPU and FPU by the rules in the mk directory.

This breaks the genlink tests.

genlink: simplified devices.data

devices.data already had the information about the family name.
By using the first field (by the pattern used to match it) as family name information that data doesn't
have to be provided explicitly. The same data is used to generate the
CPPFLAGS, such as -DSTM32F1

The architectures block of the devices.data file was redundant.

genlink-config.mk uses family and subfamily to figure out which libopencm3
variant actually exists.
This commit is contained in:
Jonas Meyer
2016-02-06 02:03:57 +01:00
committed by Karl Palsson
parent 2db3d290e7
commit c025dc0327
5 changed files with 142 additions and 97 deletions

View File

@@ -39,27 +39,40 @@ BEGIN {
if (PAT ~ tmp) {
if ($2 != "+")
PAT=$2;
for (i = 3; i <= NF; i = i + 1) {
if ($i ~ /^-l/) {
if ("LIB" ~ MODE)
printf "%s ",$i;
for (i = 3; i <= NF; i = i + 1) {
if ($i ~ /^CPU=/) {
if ("CPU" ~ MODE){
sub(/[^=]*=/,"",$i);
printf "%s",$i;
exit;
}
}
else if ($i ~ /^-m/) {
if ("ARCH" ~ MODE)
printf "%s ",$i;
else if ($i ~ /^FPU=/) {
if ("FPU" ~ MODE){
sub(/[^=]*=/,"",$i);
printf "%s",$i;
exit;
}
}
else if ($i ~ /^-D/) {
if ("DEFS" ~ MODE)
printf "%s ",$i;
}
else {
else if ($i ~ /[[:upper:]]*=/) {
if ("DEFS" ~ MODE)
printf "-D_%s ",$i;
}
}
if (PAT=="END")
if (PAT=="END"){
if ("FAMILY" ~ MODE)
printf "%s",family;
else if ("SUBFAMILY" ~ MODE)
printf "%s",subfamily;
exit;
}
else{
subfamily = family;
family = PAT;
if ("CPPFLAGS" ~ MODE)
printf "-D%s ",toupper(PAT);
else if("DEFS" ~ MODE)
printf "-D%s ",toupper(PAT);
}
}
}