-
Notifications
You must be signed in to change notification settings - Fork 6
/
SConstruct
38 lines (27 loc) · 965 Bytes
/
SConstruct
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
import os
from os.path import join
from os.path import expanduser
from SCons.Script import Environment
# ---------------------- FILES --------------------------
# -- Boards file
BOARDF = join('platformio', 'boards', 'lattice.json')
# -- Platform file
PLATF = join('platformio', 'platforms', 'lattice_ice40.py')
# -- Build file
BUILDF = join('platformio', 'builder', 'scripts', 'lattice_ice40.py')
# -- Get the user home directory
HOME = expanduser("~")
# -- Platformio home user dir
DEST_DIR = join(HOME, '.platformio')
# -- Create the building environment
env = Environment()
# -- Installing files
file1 = env.File(BOARDF)
inst1 = env.Install(join(DEST_DIR, 'boards'), file1)
file2 = env.File(PLATF)
inst2 = env.Install(join(DEST_DIR, 'platforms'), file2)
file3 = env.File(BUILDF)
inst3 = env.InstallAs(join(DEST_DIR, 'platforms', 'lattice_ice40-builder.py'),
file3)
# -- Install target
env.Alias('install', [inst1, inst2, inst3])