[synwit] add variant_dir for libraries building

This commit is contained in:
Xian Wu 2023-12-28 15:04:59 +08:00 committed by GitHub
parent 0ad5c9585d
commit 22b9de6f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 11 deletions

View File

@ -40,10 +40,10 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
libraries_path = os.path.join(GetCurrentDir(), '..', 'libraries')
# include libraries
objs += SConscript(os.path.join(libraries_path, 'SWM320_CSL', 'SConscript'))
objs += SConscript(os.path.join(libraries_path, 'SWM320_CSL', 'SConscript'), variant_dir='build/libraries/SWM320_CSL', duplicate=0)
# include drivers
objs += SConscript(os.path.join(libraries_path, 'SWM320_drivers', 'SConscript'))
objs += SConscript(os.path.join(libraries_path, 'SWM320_drivers', 'SConscript'), variant_dir='build/libraries/SWM320_drivers', duplicate=0)
# make a building
DoBuilding(TARGET, objs)

View File

@ -39,8 +39,9 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy'
TARGET_EXT = 'elf'
DEVICE = ' -mcpu=' + CPU + ' -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -g -Wall'
DEVICE = ' -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'

View File

@ -40,10 +40,10 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
libraries_path = os.path.join(GetCurrentDir(), '..', 'libraries')
# include libraries
objs += SConscript(os.path.join(libraries_path, 'SWM341_CSL', 'SConscript'))
objs += SConscript(os.path.join(libraries_path, 'SWM341_CSL', 'SConscript'), variant_dir='build/libraries/SWM341_CSL', duplicate=0)
# include drivers
objs += SConscript(os.path.join(libraries_path, 'SWM341_drivers', 'SConscript'))
objs += SConscript(os.path.join(libraries_path, 'SWM341_drivers', 'SConscript'), variant_dir='build/libraries/SWM341_drivers', duplicate=0)
# make a building

View File

@ -3,7 +3,7 @@ import os
# toolchains options
ARCH='arm'
CPU='cortex-m33'
CROSS_TOOL='keil'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
@ -29,20 +29,20 @@ BUILD = 'debug'
#BUILD = 'release'
if PLATFORM == 'gcc':
# toolchains
PREFIX = 'arm-none-eabi-'
CC = PREFIX + 'gcc'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
CXX = PREFIX + 'g++'
LINK = PREFIX + 'gcc'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=' + CPU + ' -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc -fstack-usage -fdump-rtl-dfinish'
TARGET_EXT = 'elf'
DEVICE = ' -mcpu=cortex-m33 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb -I.'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'