Merge pull request #2498 from tyustli/master

last push forget modified the templates to support C++
This commit is contained in:
Bernard Xiong 2019-03-25 19:36:43 +08:00 committed by GitHub
commit bc6117b4e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 125 additions and 6 deletions

View File

@ -21,6 +21,7 @@ env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -46,6 +46,14 @@ SECTIONS
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4); . = ALIGN(4);
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_etext = .; _etext = .;
} > ROM = 0 } > ROM = 0
@ -72,6 +80,12 @@ SECTIONS
*(.data.*) *(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
. = ALIGN(4); . = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;

View File

@ -44,7 +44,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -std=c99 -Dgcc' CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
@ -57,11 +57,15 @@ if PLATFORM == 'gcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
CC = 'armcc' CC = 'armcc'
CXX = 'armcc'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'
@ -85,11 +89,15 @@ elif PLATFORM == 'armcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar': elif PLATFORM == 'iar':
# toolchains # toolchains
CC = 'iccarm' CC = 'iccarm'
CXX = 'iccarm'
AS = 'iasmarm' AS = 'iasmarm'
AR = 'iarchive' AR = 'iarchive'
LINK = 'ilinkarm' LINK = 'ilinkarm'
@ -130,5 +138,7 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config "board/linker_scripts/link.icf"' LFLAGS = ' --config "board/linker_scripts/link.icf"'
LFLAGS += ' --entry __iar_program_start' LFLAGS += ' --entry __iar_program_start'
CXXFLAGS = CFLAGS
EXEC_PATH = EXEC_PATH + '/arm/bin/' EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'

View File

@ -21,6 +21,7 @@ env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -46,6 +46,14 @@ SECTIONS
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4); . = ALIGN(4);
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_etext = .; _etext = .;
} > ROM = 0 } > ROM = 0
@ -72,6 +80,11 @@ SECTIONS
*(.data.*) *(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
. = ALIGN(4); . = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;

View File

@ -44,7 +44,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -std=c99 -Dgcc' CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
@ -57,11 +57,15 @@ if PLATFORM == 'gcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
CC = 'armcc' CC = 'armcc'
CXX = 'armcc'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'
@ -85,11 +89,15 @@ elif PLATFORM == 'armcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar': elif PLATFORM == 'iar':
# toolchains # toolchains
CC = 'iccarm' CC = 'iccarm'
CXX = 'iccarm'
AS = 'iasmarm' AS = 'iasmarm'
AR = 'iarchive' AR = 'iarchive'
LINK = 'ilinkarm' LINK = 'ilinkarm'
@ -130,5 +138,7 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config "board/linker_scripts/link.icf"' LFLAGS = ' --config "board/linker_scripts/link.icf"'
LFLAGS += ' --entry __iar_program_start' LFLAGS += ' --entry __iar_program_start'
CXXFLAGS = CFLAGS
EXEC_PATH = EXEC_PATH + '/arm/bin/' EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'

View File

@ -21,6 +21,7 @@ env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -47,6 +47,14 @@ SECTIONS
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4); . = ALIGN(4);
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_etext = .; _etext = .;
} > ROM = 0 } > ROM = 0
@ -73,6 +81,11 @@ SECTIONS
*(.data.*) *(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
. = ALIGN(4); . = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;

View File

@ -44,7 +44,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -std=c99 -Dgcc' CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
@ -57,11 +57,15 @@ if PLATFORM == 'gcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
CC = 'armcc' CC = 'armcc'
CXX = 'armcc'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'
@ -85,11 +89,15 @@ elif PLATFORM == 'armcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar': elif PLATFORM == 'iar':
# toolchains # toolchains
CC = 'iccarm' CC = 'iccarm'
CXX = 'iccarm'
AS = 'iasmarm' AS = 'iasmarm'
AR = 'iarchive' AR = 'iarchive'
LINK = 'ilinkarm' LINK = 'ilinkarm'
@ -130,5 +138,7 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config "board/linker_scripts/link.icf"' LFLAGS = ' --config "board/linker_scripts/link.icf"'
LFLAGS += ' --entry __iar_program_start' LFLAGS += ' --entry __iar_program_start'
CXXFLAGS = CFLAGS
EXEC_PATH = EXEC_PATH + '/arm/bin/' EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'

View File

@ -21,6 +21,7 @@ env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -47,6 +47,14 @@ SECTIONS
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4); . = ALIGN(4);
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_etext = .; _etext = .;
} > ROM = 0 } > ROM = 0
@ -73,6 +81,11 @@ SECTIONS
*(.data.*) *(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
. = ALIGN(4); . = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;

View File

@ -44,7 +44,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -std=c99 -Dgcc' CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
@ -57,11 +57,15 @@ if PLATFORM == 'gcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
CC = 'armcc' CC = 'armcc'
CXX = 'armcc'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'
@ -85,12 +89,14 @@ elif PLATFORM == 'armcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS CXXFLAGS = CFLAGS
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar': elif PLATFORM == 'iar':
# toolchains # toolchains
CC = 'iccarm' CC = 'iccarm'
CXX = 'iccarm'
AS = 'iasmarm' AS = 'iasmarm'
AR = 'iarchive' AR = 'iarchive'
LINK = 'ilinkarm' LINK = 'ilinkarm'
@ -131,5 +137,7 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config "board/linker_scripts/link.icf"' LFLAGS = ' --config "board/linker_scripts/link.icf"'
LFLAGS += ' --entry __iar_program_start' LFLAGS += ' --entry __iar_program_start'
CXXFLAGS = CFLAGS
EXEC_PATH = EXEC_PATH + '/arm/bin/' EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'

View File

@ -21,6 +21,7 @@ env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -46,6 +46,14 @@ SECTIONS
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4); . = ALIGN(4);
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_etext = .; _etext = .;
} > ROM = 0 } > ROM = 0
@ -72,6 +80,11 @@ SECTIONS
*(.data.*) *(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
. = ALIGN(4); . = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */ /* This is used by the startup in order to initialize the .data secion */
_edata = . ; _edata = . ;

View File

@ -44,7 +44,7 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -std=c99 -Dgcc' CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
@ -57,11 +57,15 @@ if PLATFORM == 'gcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armcc':
# toolchains # toolchains
CC = 'armcc' CC = 'armcc'
CXX = 'armcc'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'
@ -85,11 +89,15 @@ elif PLATFORM == 'armcc':
else: else:
CFLAGS += ' -O2' CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
CFLAGS += ' -std=c99'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar': elif PLATFORM == 'iar':
# toolchains # toolchains
CC = 'iccarm' CC = 'iccarm'
CXX = 'iccarm'
AS = 'iasmarm' AS = 'iasmarm'
AR = 'iarchive' AR = 'iarchive'
LINK = 'ilinkarm' LINK = 'ilinkarm'
@ -130,5 +138,7 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config "board/linker_scripts/link.icf"' LFLAGS = ' --config "board/linker_scripts/link.icf"'
LFLAGS += ' --entry __iar_program_start' LFLAGS += ' --entry __iar_program_start'
CXXFLAGS = CFLAGS
EXEC_PATH = EXEC_PATH + '/arm/bin/' EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'