2020-04-16 16:10:57 +08:00
|
|
|
import os
|
|
|
|
|
|
|
|
# toolchains options
|
|
|
|
ARCH ='aarch64'
|
2021-09-22 17:57:45 +08:00
|
|
|
CPU ='cortex-a'
|
2020-04-16 16:10:57 +08:00
|
|
|
CROSS_TOOL ='gcc'
|
|
|
|
|
|
|
|
if os.getenv('RTT_ROOT'):
|
|
|
|
RTT_ROOT = os.getenv('RTT_ROOT')
|
|
|
|
else:
|
|
|
|
RTT_ROOT = r'../../..'
|
|
|
|
|
|
|
|
if os.getenv('RTT_CC'):
|
|
|
|
CROSS_TOOL = os.getenv('RTT_CC')
|
|
|
|
|
|
|
|
PLATFORM = 'gcc'
|
|
|
|
EXEC_PATH = r'/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-elf/bin/'
|
|
|
|
|
2022-01-07 13:49:06 +08:00
|
|
|
if os.getenv('RTT_EXEC_PATH'):
|
|
|
|
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
|
|
|
|
2020-04-16 16:10:57 +08:00
|
|
|
BUILD = 'debug'
|
|
|
|
|
|
|
|
if PLATFORM == 'gcc':
|
|
|
|
# toolchains
|
2022-12-20 17:49:37 +08:00
|
|
|
PREFIX = os.getenv('RTT_CC_PREFIX') or 'aarch64-none-elf-'
|
2020-04-16 16:10:57 +08:00
|
|
|
CC = PREFIX + 'gcc'
|
|
|
|
CXX = PREFIX + 'g++'
|
|
|
|
AS = PREFIX + 'gcc'
|
|
|
|
AR = PREFIX + 'ar'
|
|
|
|
LINK = PREFIX + 'gcc'
|
|
|
|
TARGET_EXT = 'elf'
|
|
|
|
SIZE = PREFIX + 'size'
|
|
|
|
OBJDUMP = PREFIX + 'objdump'
|
|
|
|
OBJCPY = PREFIX + 'objcopy'
|
|
|
|
|
2020-04-16 18:48:27 +08:00
|
|
|
DEVICE = ' -march=armv8-a -mtune=cortex-a72'
|
2023-03-29 18:31:05 +08:00
|
|
|
CFLAGS = DEVICE + ' -Wall -Wno-cpp -D_POSIX_SOURCE'
|
2020-04-16 16:10:57 +08:00
|
|
|
AFLAGS = ' -c' + ' -x assembler-with-cpp -D__ASSEMBLY__'
|
|
|
|
LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors -T link.lds'
|
|
|
|
CPATH = ''
|
|
|
|
LPATH = ''
|
|
|
|
|
|
|
|
if BUILD == 'debug':
|
2023-03-29 18:31:05 +08:00
|
|
|
CFLAGS += ' -O0 -ggdb'
|
|
|
|
AFLAGS += ' -ggdb'
|
2020-04-16 16:10:57 +08:00
|
|
|
else:
|
|
|
|
CFLAGS += ' -O2'
|
|
|
|
|
|
|
|
CXXFLAGS = CFLAGS
|
|
|
|
|
|
|
|
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
|
|
|
|
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
|