@@ -36,6 +36,8 @@ BEGIN {
option[""] = ""
tiny_stack[""] = 1
comment = 1
+ n_mcu = 0
+ n_cores = 0
mtiny[0] = ""
mtiny[1] = "tiny-stack"
@@ -110,7 +112,8 @@ BEGIN {
if (core == "avr1")
next
- cores[length (cores)] = core
+ cores[n_cores] = core
+ n_cores++
tiny_stack[core] = 0
option[core] = "mmcu=" core
@@ -122,7 +125,8 @@ BEGIN {
next
tiny_stack[name] = $5
- mcu[length (mcu)] = name
+ mcu[n_mcu] = name
+ n_mcu++
option[name] = "mmcu=" name
toCore[name] = core
@@ -157,7 +161,7 @@ END {
# (avr2, avr25, ...) x mtiny-stack
sep = ""
- for (c = 0; c < length (cores); c++)
+ for (c = 0; c < n_cores; c++)
{
m_options = m_options sep option[cores[c]]
sep = "/"
@@ -175,7 +179,7 @@ END {
dot_excludes = ""
m_raw_sp8 = ""
- for (t = 0; t < length (mcu); t++)
+ for (t = 0; t < n_mcu; t++)
{
core = toCore[mcu[t]]
@@ -212,8 +216,9 @@ END {
####################################################################
# Compose MULTILIB_DIRNAMES, MULTILIB_EXEPTIONS and avr_multilib_raw
- for (t = 0; t < length (mtiny); t++)
- for (c = -1; c < length (cores); c++)
+ n_mtiny = 2
+ for (t = 0; t < n_mtiny; t++)
+ for (c = -1; c < n_cores; c++)
{
if (c == -1)
core = ""
@@ -255,7 +260,7 @@ END {
line = mdir
- for (s = 0; s < length (cores); s++)
+ for (s = 0; s < n_cores; s++)
{
if (cores[s] == core)
line = line " " option[cores[s]]