-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSConscript
91 lines (75 loc) · 3.47 KB
/
SConscript
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#-*- encoding: utf-8 -*-
#---------------------------------------------------------------------------------
# @File: Sconscript for Package
# @Author: Copyright (c) 2018-2019, liu2guang [email protected]
#---------------------------------------------------------------------------------
import os
from building import *
Import('RTT_ROOT')
Import('rtconfig')
#---------------------------------------------------------------------------------
# Package configuration
#---------------------------------------------------------------------------------
PKGNAME = "libsquash"
DEPENDS = []
# DEPENDS = ["RT_USING_DFS", "RT_USING_DFS_SQUASHFS"]
#---------------------------------------------------------------------------------
# Compile the configuration
#---------------------------------------------------------------------------------
SOURCES = Glob("*.c") + Glob("libsquash/src/*.c")
LOCAL_CPPPATH = []
LOCAL_CCFLAGS = ""
LOCAL_ASFLAGS = ""
CPPPATH = [os.path.join(GetCurrentDir(), 'libsquash/include')]
CCFLAGS = ""
ASFLAGS = ""
CPPDEFINES = ["_RTTHREAD"]
LOCAL_CPPDEFINES = []
LIBS = []
LIBPATH = [GetCurrentDir()]
LINKFLAGS = ""
#---------------------------------------------------------------------------------
# Feature clip configuration, optional
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
# Compiler platform configuration, optional
#---------------------------------------------------------------------------------
if rtconfig.CROSS_TOOL == "gcc":
LOCAL_CCFLAGS += ' -std=gnu99 -Ofast -w'
if rtconfig.CROSS_TOOL == "iar":
print("Warning: No iar platform was tested!!!")
if rtconfig.CROSS_TOOL == "keil":
LOCAL_CCFLAGS += ' --gnu -W --diag_suppress=870'
#---------------------------------------------------------------------------------
# System variables
#---------------------------------------------------------------------------------
objs = []
root = GetCurrentDir()
#---------------------------------------------------------------------------------
# Sub target
#---------------------------------------------------------------------------------
list = os.listdir(root)
if GetDepend(DEPENDS):
for d in list:
path = os.path.join(root, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
#---------------------------------------------------------------------------------
# Main target
#---------------------------------------------------------------------------------
objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
CPPPATH = CPPPATH,
CCFLAGS = CCFLAGS,
ASFLAGS = ASFLAGS,
LOCAL_CPPPATH = LOCAL_CPPPATH,
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
CPPDEFINES = CPPDEFINES,
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
LIBS = LIBS,
LIBPATH = LIBPATH,
LINKFLAGS = LINKFLAGS)
Return("objs")
#---------------------------------------------------------------------------------
# End
#---------------------------------------------------------------------------------