diff --git a/arduino/descript.ion b/arduino/descript.ion deleted file mode 100644 index 722627e..0000000 --- a/arduino/descript.ion +++ /dev/null @@ -1,2 +0,0 @@ -realtek-ambz Realtek AmebaZ Arduino Core -libretuya Interfaces for LibreTuya Arduino cores diff --git a/boards/_base/beken-72xx.json b/boards/_base/beken-72xx.json index 272105b..609141d 100644 --- a/boards/_base/beken-72xx.json +++ b/boards/_base/beken-72xx.json @@ -1,6 +1,7 @@ { "build": { - "f_cpu": "120000000L" + "f_cpu": "120000000L", + "prefix": "arm-none-eabi-" }, "connectivity": [ "wifi", diff --git a/boards/_base/realtek-ambz.json b/boards/_base/realtek-ambz.json index 7bd9ff1..0d07fc1 100644 --- a/boards/_base/realtek-ambz.json +++ b/boards/_base/realtek-ambz.json @@ -2,6 +2,7 @@ "build": { "family": "RTL8710B", "f_cpu": "125000000L", + "prefix": "arm-none-eabi-", "amb_flash_addr": "0x08000000" }, "connectivity": [ diff --git a/builder/main.py b/builder/main.py index 8865d0a..d3fdfa4 100644 --- a/builder/main.py +++ b/builder/main.py @@ -28,18 +28,19 @@ if env.get("PROGNAME", "program") == "program": env.Replace(PROGSUFFIX=".elf") # Toolchain config - TODO multiple arch, specified in board.json +prefix = board.get("build.prefix", "") env.Replace( - AR="arm-none-eabi-gcc-ar", - AS="arm-none-eabi-gcc", - CC="arm-none-eabi-gcc", - CXX="arm-none-eabi-g++", - GDB="arm-none-eabi-gdb", - NM="arm-none-eabi-gcc-nm", - LINK="arm-none-eabi-gcc", - OBJCOPY="arm-none-eabi-objcopy", - OBJDUMP="arm-none-eabi-objdump", - # RANLIB="arm-none-eabi-gcc-ranlib", - SIZETOOL="arm-none-eabi-size", + AR=prefix + "gcc-ar", + AS=prefix + "gcc", + CC=prefix + "gcc", + CXX=prefix + "g++", + GDB=prefix + "gdb", + NM=prefix + "gcc-nm", + LINK=prefix + "gcc", + OBJCOPY=prefix + "objcopy", + OBJDUMP=prefix + "objdump", + # RANLIB=prefix + "gcc-ranlib", + SIZETOOL=prefix + "size", ) # Default environment options diff --git a/builder/utils/libs.py b/builder/utils/libs.py index bd88c84..056b588 100644 --- a/builder/utils/libs.py +++ b/builder/utils/libs.py @@ -54,11 +54,12 @@ def env_add_library( srcs.append("-<" + expr + ">") # queue library for further env clone and build - env.Prepend( - LIBQUEUE=[ - (join("$BUILD_DIR", name), base_dir, srcs, options), - ] - ) + if srcs: + env.Prepend( + LIBQUEUE=[ + (join("$BUILD_DIR", name), base_dir, srcs, options), + ] + ) # search all include paths for dir, expr in iter_expressions(includes):