summaryrefslogtreecommitdiff
path: root/libcpu/aarch64/SConscript
blob: 957708fd996afdc4c34dc53100db24d5f342cbd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# RT-Thread building script for bridge

import os
import re
from building import *

Import('rtconfig')

cwd   = GetCurrentDir()
group = []
list  = os.listdir(cwd)
bsp_path = Dir('#').abspath

if not os.path.exists(bsp_path + "/link.lds"):
    Env['LINKFLAGS'] = Env['LINKFLAGS'].replace('link.lds', cwd + "/link.lds")
    Preprocessing("link.lds.S", ".lds", CPPPATH=[bsp_path])

# fix the linker with crtx.o
Env['LINKFLAGS'] += ' -nostartfiles'

# add common code files
group = group + SConscript(os.path.join('common', 'SConscript'))

# cpu porting code files
if rtconfig.CPU != 'common':
    group = group + SConscript(os.path.join(rtconfig.CPU, 'SConscript'))

def del_gnu99():
    for g in Projects:
        if g["name"] == "Kernel":
            flags = re.sub(r'\s+', ' ', re.sub(r'\s*-std=gnu99\s*', ' ', g["LOCAL_CFLAGS"])).strip()
            flags = re.sub(r'(?<!\s)(-Wunused)', r' \1', flags)
            g["LOCAL_CFLAGS"] = flags

RegisterPreBuildingAction(del_gnu99)
Return('group')