diff options
| author | prife <[email protected]> | 2013-02-26 16:03:08 +0800 |
|---|---|---|
| committer | prife <[email protected]> | 2013-02-26 16:03:08 +0800 |
| commit | 9ccdf4172ee0fc3e7fe8ac0db122a81572e9c0f8 (patch) | |
| tree | d46136702ab7898c6ac2488447a7d548ff76a252 /bsp/simulator/rtconfig.py | |
| parent | 278cc914b3ba76a0c7a6b46d23f0f1bbc7491331 (diff) | |
basic mingw support for simulator: kernel and finsh
Diffstat (limited to 'bsp/simulator/rtconfig.py')
| -rwxr-xr-x | bsp/simulator/rtconfig.py | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/bsp/simulator/rtconfig.py b/bsp/simulator/rtconfig.py index 4007e0b1d8..3d0c641ef6 100755 --- a/bsp/simulator/rtconfig.py +++ b/bsp/simulator/rtconfig.py @@ -1,7 +1,7 @@ # toolchains options ARCH='sim' #CROSS_TOOL='msvc' or 'gcc' or 'mingw' (mingw is not supported yet!) -CROSS_TOOL='msvc' +CROSS_TOOL='mingw' # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path @@ -10,11 +10,20 @@ if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = '/usr/bin/gcc' -if CROSS_TOOL == 'msvc': +elif CROSS_TOOL == 'mingw': + CPU = 'win32' + PLATFORM = 'mingw' + EXEC_PATH = r'D:\Program Files\CodeBlocks\MinGW\bin' + +elif CROSS_TOOL == 'msvc': CPU = 'win32' PLATFORM = 'cl' EXEC_PATH = '' +else : + print "bad CROSS TOOL!" + exit(1) + BUILD = 'debug' #BUILD = '' @@ -48,6 +57,35 @@ if PLATFORM == 'gcc': POST_ACTION = '' +elif PLATFORM == 'mingw': + # toolchains + PREFIX = '' + CC = PREFIX + 'gcc' + AS = PREFIX + 'gcc' + AR = PREFIX + 'ar' + LINK = PREFIX + 'gcc' + TARGET_EXT = 'exe' + SIZE = PREFIX + 'size' + OBJDUMP = PREFIX + 'objdump' + OBJCPY = PREFIX + 'objcopy' + + DEVICE = ' -ffunction-sections -fdata-sections' + DEVICE = ' ' + CFLAGS = ' -Wl,--output-def ' + AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' + #LFLAGS = DEVICE + ' -Wl,-Map=rtthread-win32.map -T mingw.ld' + LFLAGS = DEVICE + ' -Wl,-Map=rtthread-win32.map --gc-sections,--whole-archive -T mingw.ld ' + CPATH = '' + LPATH = '' + + if BUILD == 'debug': + CFLAGS += ' -g -O0 -gdwarf-2' + AFLAGS += ' -gdwarf-2' + else: + CFLAGS += ' -O2' + + POST_ACTION = '' + elif PLATFORM == 'cl': # toolchains PREFIX = '' |
