diff --git a/bsp/nuvoton/libraries/m480/StdDriver/SConscript b/bsp/nuvoton/libraries/m480/StdDriver/SConscript index e9e9a339e3..6a932cff58 100644 --- a/bsp/nuvoton/libraries/m480/StdDriver/SConscript +++ b/bsp/nuvoton/libraries/m480/StdDriver/SConscript @@ -3,24 +3,26 @@ Import('rtconfig') from building import * cwd = GetCurrentDir() -src = [] -libs = [''] -libpath = [cwd + '/lib'] +libs = [] +src = Glob('*src/*.c') + Glob('src/*.cpp') cpppath = [cwd + '/inc'] +libpath = [cwd + '/lib'] -if GetDepend('BSP_USE_STDDRIVER_SOURCE'): - src = Glob('*src/*.c') + Glob('src/*.cpp') +if not GetDepend('BSP_USE_STDDRIVER_SOURCE'): + if rtconfig.CROSS_TOOL == 'keil': + if GetOption('target') == 'mdk5' and os.path.isfile('./lib/libstddriver_keil.lib'): + libs += ['libstddriver_keil'] + elif GetOption('target') == 'mdk4' and os.path.isfile('./lib/libstddriver_keil4.lib'): + libs += ['libstddriver_keil4'] + elif rtconfig.CROSS_TOOL == 'gcc' and os.path.isfile('./lib/libstddriver_gcc.a'): + libs += ['libstddriver_gcc'] + elif os.path.isfile('./lib/libstddriver_iar.a'): + libs += ['libstddriver_iar'] + +if not libs: group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath) else: - if rtconfig.CROSS_TOOL == 'keil': - if GetOption('target') == 'mdk4': - libs += ['libstddriver_keil4'] - if GetOption('target') == 'mdk5': - libs += ['libstddriver_keil'] - elif rtconfig.CROSS_TOOL == 'gcc': - libs += ['libstddriver_gcc'] - else: - libs += ['libstddriver_iar'] + src = [] group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath) Return('group') diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_gcc.a b/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_gcc.a deleted file mode 100644 index e3fba2d475..0000000000 Binary files a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_gcc.a and /dev/null differ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_iar.a b/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_iar.a deleted file mode 100644 index e1e77aeeea..0000000000 Binary files a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_iar.a and /dev/null differ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_keil.lib b/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_keil.lib deleted file mode 100644 index 60caa8624d..0000000000 Binary files a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_keil.lib and /dev/null differ diff --git a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_keil4.lib b/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_keil4.lib deleted file mode 100644 index 95c172640e..0000000000 Binary files a/bsp/nuvoton/libraries/m480/StdDriver/lib/libstddriver_keil4.lib and /dev/null differ