diff --git a/bsp/amebaz/SConstruct b/bsp/amebaz/SConstruct index 19506eba01..713fe15443 100644 --- a/bsp/amebaz/SConstruct +++ b/bsp/amebaz/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/gd32303e-eval/SConstruct b/bsp/gd32303e-eval/SConstruct index 4e05637e6a..1cdbaab4a8 100644 --- a/bsp/gd32303e-eval/SConstruct +++ b/bsp/gd32303e-eval/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/gd32450z-eval/SConstruct b/bsp/gd32450z-eval/SConstruct index 27ac9b0241..adf9077eac 100644 --- a/bsp/gd32450z-eval/SConstruct +++ b/bsp/gd32450z-eval/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/imxrt/imxrt1050-ArchMix/SConstruct b/bsp/imxrt/imxrt1050-ArchMix/SConstruct index ea53aac131..2b4a2ead73 100644 --- a/bsp/imxrt/imxrt1050-ArchMix/SConstruct +++ b/bsp/imxrt/imxrt1050-ArchMix/SConstruct @@ -35,7 +35,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/imxrt/imxrt1050-evk/SConstruct b/bsp/imxrt/imxrt1050-evk/SConstruct index 5f99b4eed1..4b172a3538 100644 --- a/bsp/imxrt/imxrt1050-evk/SConstruct +++ b/bsp/imxrt/imxrt1050-evk/SConstruct @@ -35,7 +35,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/imxrt1052-evk/SConstruct b/bsp/imxrt1052-evk/SConstruct index f6e51cbf6a..be5ba963ce 100644 --- a/bsp/imxrt1052-evk/SConstruct +++ b/bsp/imxrt1052-evk/SConstruct @@ -34,9 +34,9 @@ else: env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/lpc54114-lite/SConstruct b/bsp/lpc54114-lite/SConstruct index ab84f82f3c..aa0f6a15a3 100644 --- a/bsp/lpc54114-lite/SConstruct +++ b/bsp/lpc54114-lite/SConstruct @@ -28,7 +28,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/lpc824/SConstruct b/bsp/lpc824/SConstruct index 9d111f8821..a87696475d 100644 --- a/bsp/lpc824/SConstruct +++ b/bsp/lpc824/SConstruct @@ -22,9 +22,9 @@ env = Environment(tools = ['mingw'], env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/mb9bf500r/SConstruct b/bsp/mb9bf500r/SConstruct index 1deefb8ffd..be2a125e2c 100644 --- a/bsp/mb9bf500r/SConstruct +++ b/bsp/mb9bf500r/SConstruct @@ -20,9 +20,9 @@ env = Environment(tools = ['mingw'], env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) - env.Replace(ARFLAGS = '') + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/mb9bf506r/SConstruct b/bsp/mb9bf506r/SConstruct index 8c58439102..5c060833f4 100644 --- a/bsp/mb9bf506r/SConstruct +++ b/bsp/mb9bf506r/SConstruct @@ -20,9 +20,9 @@ env = Environment(tools = ['mingw'], env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) - env.Replace(ARFLAGS = '') + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/mb9bf618s/SConstruct b/bsp/mb9bf618s/SConstruct index 8c58439102..5c060833f4 100644 --- a/bsp/mb9bf618s/SConstruct +++ b/bsp/mb9bf618s/SConstruct @@ -20,9 +20,9 @@ env = Environment(tools = ['mingw'], env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) - env.Replace(ARFLAGS = '') + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/nuvoton_nuc472/SConstruct b/bsp/nuvoton_nuc472/SConstruct index ece15e2a05..9257163aef 100644 --- a/bsp/nuvoton_nuc472/SConstruct +++ b/bsp/nuvoton_nuc472/SConstruct @@ -20,9 +20,9 @@ env = Environment(tools = ['mingw'], env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/swm320-lq100/SConstruct b/bsp/swm320-lq100/SConstruct index 331f1056f5..44567aea78 100644 --- a/bsp/swm320-lq100/SConstruct +++ b/bsp/swm320-lq100/SConstruct @@ -25,9 +25,9 @@ env = Environment(tools = ['mingw'], env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': - env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rtthread.map']) + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/upd70f3454/SConstruct b/bsp/upd70f3454/SConstruct index 589cdbeb80..a342385d85 100644 --- a/bsp/upd70f3454/SConstruct +++ b/bsp/upd70f3454/SConstruct @@ -21,8 +21,8 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -f lnk70f3454.xcl -l rtthread.map -Omotorola-s28=$TARGET']) - env.Replace(ARFLAGS = '') + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/tools/building.py b/tools/building.py index ef1cb3da66..978c0f7237 100644 --- a/tools/building.py +++ b/tools/building.py @@ -273,6 +273,13 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ env['LIBLINKSUFFIX'] = '.lib' env['LIBDIRPREFIX'] = '--userlibpath ' + elif rtconfig.PLATFORM == 'iar': + env['LIBPREFIX'] = '' + env['LIBSUFFIX'] = '.a' + env['LIBLINKPREFIX'] = '' + env['LIBLINKSUFFIX'] = '.a' + env['LIBDIRPREFIX'] = '--search ' + # patch for win32 spawn if env['PLATFORM'] == 'win32': win32_spawn = Win32Spawn()