Skip to content

Commit 2d2b017

Browse files
committed
Set Make in build call
1 parent f771d82 commit 2d2b017

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

MaximSDK/Inject/.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
{
77
"label": "build",
88
"type": "shell",
9-
"command": "make -j 8 TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} all",
9+
"command": "make -j 8 all TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
1010
"group": "build",
1111
"problemMatcher": []
1212
},
1313
{
1414
"label": "clean",
1515
"type": "shell",
16-
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
16+
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
1717
"group": "build",
1818
"problemMatcher": []
1919
},
2020
{
2121
"label": "clean-periph",
2222
"type": "shell",
23-
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
23+
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
2424
"group": "build",
2525
"problemMatcher": []
2626
},

MaximSDK/New_Project/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"terminal.integrated.env.windows": {
3-
"Path":"${config:MAXIM_PATH}/Tools/MinGW/msys/1.0/bin;${config:MAXIM_PATH}/Tools/OpenOCD;${config:MAXIM_PATH}/Tools/GNUTools/bin;${config:MAXIM_PATH}/Tools/xPack/riscv-none-embed-gcc/bin;${env:Path}"
3+
"Path":"${config:MAXIM_PATH}/Tools/MinGW/msys/1.0/bin;${config:MAXIM_PATH}/Tools/OpenOCD;${config:MAXIM_PATH}/Tools/GNUTools/bin;${config:MAXIM_PATH}/Tools/xPack/riscv-none-embed-gcc/bin;${env:Path}"
44
},
55

66
"terminal.integrated.env.linux": {

MaximSDK/New_Project/.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
{
77
"label": "build",
88
"type": "shell",
9-
"command": "make -j 8 TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} all",
9+
"command": "make -j 8 all TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
1010
"group": "build",
1111
"problemMatcher": []
1212
},
1313
{
1414
"label": "clean",
1515
"type": "shell",
16-
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
16+
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
1717
"group": "build",
1818
"problemMatcher": []
1919
},
2020
{
2121
"label": "clean-periph",
2222
"type": "shell",
23-
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
23+
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
2424
"group": "build",
2525
"problemMatcher": []
2626
},

maintain.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import platform
3939
import time
4040

41+
curplatform = platform.system() # Get OS
42+
4143
def log(string, file):
4244
print(string)
4345
file.write(f"{string}\n")
@@ -54,25 +56,22 @@ def wrapper(*args, **kwargs):
5456
start = time.time() # Start timer
5557
res = f(*args, **kwargs)
5658
end = time.time() # Stop timer
57-
global duration
59+
global duration # Use global duration variable so main script can access elapsed time
5860
duration = end - start # Calculate duration
5961

6062
return res
6163

6264
return wrapper
6365

66+
# Run powershell command. On linux, run a shell command
6467
@time_me
6568
def ps(cmd, env=None):
66-
# Windows
67-
# if env is None:
68-
# result = run(["powershell", cmd], capture_output=True)
69-
70-
# else:
71-
# result = run(["powershell", cmd], env=env, capture_output=True)
72-
73-
# Linux
74-
if env is None: result = run(cmd, capture_output=True, shell=True)
75-
else: result = run(cmd, env=env, capture_output=True, shell=True)
69+
if curplatform == 'Linux':
70+
if env is None: result = run(cmd, capture_output=True, shell=True)
71+
else: result = run(cmd, env=env, capture_output=True, shell=True)
72+
elif curplatform == 'Windows':
73+
if env is None: result = run(["powershell", cmd], capture_output=True)
74+
else: result = run(["powershell", cmd], env=env, capture_output=True)
7675

7776
return result
7877

@@ -120,7 +119,6 @@ def release(version):
120119
# Tests cleaning and compiling example projects for target platforms. If no targets, boards, projects, etc. are specified then it will auto-detect
121120
def test(targets=None, boards=None, projects=None):
122121
env = os.environ.copy()
123-
curplatform = platform.system()
124122

125123
# Simulate the VS Code terminal by appending to the Path
126124
MAXIM_PATH = ""

0 commit comments

Comments
 (0)