forked from pikasTech/PikaPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConscript
66 lines (55 loc) · 1.7 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
# RT-Thread building script for bridge
import os, shutil
import subprocess
from building import *
def pikascript_init():
cwd = GetCurrentDir()
def mycopyfile(srcfile,dstfile):
if not os.path.isfile(srcfile):
pass
else:
fpath,fname=os.path.split(dstfile)
if not os.path.exists(fpath):
os.makedirs(fpath)
shutil.copyfile(srcfile,dstfile)
mycopyfile(cwd + '/port/rt-thread/main.py', cwd + '/main.py')
mycopyfile(cwd + '/port/rt-thread/pikaPackage.exe', cwd + '/pikaPackage.exe')
mycopyfile(cwd + '/port/rt-thread/requestment.txt', cwd + '/requestment.txt')
def myremove(path):
all_path = cwd + '\\' + path
os.popen('del ' + all_path + ' /F /Q /S')
os.popen('rd ' + all_path + ' /Q /S')
myremove('assets')
myremove('docker')
myremove('bsp')
myremove('document')
myremove('examples')
myremove('package')
myremove('port')
myremove('src')
myremove('test')
myremove('tools')
myremove('.github')
myremove('.git')
myremove('.vscode')
myremove('.gitattributes')
myremove('.gitignore')
myremove('logo.txt')
myremove('packages.toml')
os.system(cwd + '/' + 'pikaPackage.exe')
os.system(cwd + '/' + 'rust-msc-latest-win10.exe')
# init pikascript
pikascript_init()
# init argument
cwd = GetCurrentDir()
group = []
src = []
inc = []
# add file and path
for root, dirs, files in os.walk(cwd):
for dir in dirs:
print(dir)
src = Glob(os.path.join(root,dir,'*.c'))
inc = [os.path.join(root,dir)]
group += DefineGroup(dir, src, depend = ['PKG_USING_PIKASCRIPT'], CPPPATH = inc)
Return('group')