Files
lab0-0-setup-env-run-os1-d0…/ci-user/user/build.py
github-classroom[bot] 4dfe17a1b1 Initial commit
2022-06-29 12:24:12 +00:00

24 lines
522 B
Python

import os
base_address = 0x80400000
step = 0x20000
linker = "src/linker.ld"
app_id = 0
apps = os.listdir("build/app")
apps.sort()
chapter = os.getenv("CHAPTER")
for app in apps:
app = app[: app.find(".")]
os.system(
"cargo rustc --bin %s --release -- -Clink-args=-Ttext=%x"
% (app, base_address + step * app_id)
)
print(
"[build.py] application %s start with address %s"
% (app, hex(base_address + step * app_id))
)
if chapter == '3':
app_id = app_id + 1