Skip to content

Commit

Permalink
Set Make in build call
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Carter committed Nov 18, 2021
1 parent f771d82 commit 2d2b017
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
6 changes: 3 additions & 3 deletions MaximSDK/Inject/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
{
"label": "build",
"type": "shell",
"command": "make -j 8 TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} all",
"command": "make -j 8 all TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
"group": "build",
"problemMatcher": []
},
{
"label": "clean",
"type": "shell",
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
"group": "build",
"problemMatcher": []
},
{
"label": "clean-periph",
"type": "shell",
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
"group": "build",
"problemMatcher": []
},
Expand Down
2 changes: 1 addition & 1 deletion MaximSDK/New_Project/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"terminal.integrated.env.windows": {
"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}"
"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}"
},

"terminal.integrated.env.linux": {
Expand Down
6 changes: 3 additions & 3 deletions MaximSDK/New_Project/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
{
"label": "build",
"type": "shell",
"command": "make -j 8 TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} all",
"command": "make -j 8 all TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
"group": "build",
"problemMatcher": []
},
{
"label": "clean",
"type": "shell",
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
"command": "make -j 8 clean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
"group": "build",
"problemMatcher": []
},
{
"label": "clean-periph",
"type": "shell",
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH}",
"command": "make -j 8 distclean TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make",
"group": "build",
"problemMatcher": []
},
Expand Down
22 changes: 10 additions & 12 deletions maintain.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import platform
import time

curplatform = platform.system() # Get OS

def log(string, file):
print(string)
file.write(f"{string}\n")
Expand All @@ -54,25 +56,22 @@ def wrapper(*args, **kwargs):
start = time.time() # Start timer
res = f(*args, **kwargs)
end = time.time() # Stop timer
global duration
global duration # Use global duration variable so main script can access elapsed time
duration = end - start # Calculate duration

return res

return wrapper

# Run powershell command. On linux, run a shell command
@time_me
def ps(cmd, env=None):
# Windows
# if env is None:
# result = run(["powershell", cmd], capture_output=True)

# else:
# result = run(["powershell", cmd], env=env, capture_output=True)

# Linux
if env is None: result = run(cmd, capture_output=True, shell=True)
else: result = run(cmd, env=env, capture_output=True, shell=True)
if curplatform == 'Linux':
if env is None: result = run(cmd, capture_output=True, shell=True)
else: result = run(cmd, env=env, capture_output=True, shell=True)
elif curplatform == 'Windows':
if env is None: result = run(["powershell", cmd], capture_output=True)
else: result = run(["powershell", cmd], env=env, capture_output=True)

return result

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

# Simulate the VS Code terminal by appending to the Path
MAXIM_PATH = ""
Expand Down

0 comments on commit 2d2b017

Please sign in to comment.