diff options
author | Jonas Meyer <quitte@gmail.com> | 2016-02-06 04:03:57 +0300 |
---|---|---|
committer | Karl Palsson <karlp@tweak.net.au> | 2016-08-19 01:07:36 +0300 |
commit | c025dc0327c44dbaaca90e9f179ef6fe44aa233b (patch) | |
tree | d2aeddac53ccfa68d3e000a8bea72f6a6ed49b1c /scripts | |
parent | 2db3d290e7656dee85df5b3978246debf3352cac (diff) |
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.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/genlink.awk | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/scripts/genlink.awk b/scripts/genlink.awk index d2e03cf7..0eca62d6 100644 --- a/scripts/genlink.awk +++ b/scripts/genlink.awk @@ -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; - } - else if ($i ~ /^-m/) { - if ("ARCH" ~ 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 ~ /^-D/) { - if ("DEFS" ~ MODE) - printf "%s ",$i; + else if ($i ~ /^FPU=/) { + if ("FPU" ~ MODE){ + sub(/[^=]*=/,"",$i); + printf "%s",$i; + exit; + } } - 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); + } } } |