Skip to content

Commit

Permalink
builder: keep symlinking makefiles on *nix
Browse files Browse the repository at this point in the history
sbourdeauducq committed Apr 5, 2016
1 parent 42e17a4 commit 4c1a4af
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions misoc/integration/builder.py
Original file line number Diff line number Diff line change
@@ -110,9 +110,20 @@ def _generate_software(self):
for name, src_dir in self.software_packages:
dst_dir = os.path.join(self.output_dir, "software", name)
os.makedirs(dst_dir, exist_ok=True)
makefile = os.path.join(src_dir, "Makefile")
src = os.path.join(src_dir, "Makefile")
if os.name != "nt":
dst = os.path.join(dst_dir, "Makefile")
try:
os.remove(dst)
except FileNotFoundError:
pass
os.symlink(src, dst)
if self.compile_software:
subprocess.check_call(["make", "-C", dst_dir, "-f", makefile])
if os.name != "nt":
cmd = ["make", "-C", dst_dir]
else:
cmd = ["make", "-C", dst_dir, "-f", src]
subprocess.check_call(cmd)

def _initialize_rom(self):
bios_file = os.path.join(self.output_dir, "software", "bios",

0 comments on commit 4c1a4af

Please sign in to comment.