From 041483dbe1a7a79c4af97e35d19d61f33d4c4ba0 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 14 Nov 2015 03:36:46 +0100 Subject: [PATCH] soc/integration/builder: only copy Makefiles when not using symlinks --- litex/soc/integration/builder.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index 76f06a68..14ab8ba8 100644 --- a/litex/soc/integration/builder.py +++ b/litex/soc/integration/builder.py @@ -99,19 +99,17 @@ class Builder: def _prepare_software(self): for name, src_dir in self.software_packages: dst_dir = os.path.join(self.output_dir, "software", name) - if self.use_symlinks: - os.makedirs(dst_dir, exist_ok=True) - src = os.path.join(src_dir, "Makefile") - dst = os.path.join(dst_dir, "Makefile") + os.makedirs(dst_dir, exist_ok=True) + src = os.path.join(src_dir, "Makefile") + dst = os.path.join(dst_dir, "Makefile") + if self.use_symlinks: try: os.remove(dst) except FileNotFoundError: pass os.symlink(src, dst) else: - if os.path.exists(dst_dir): - shutil.rmtree(dst_dir) - shutil.copytree(src_dir, dst_dir) + shutil.copy(src, dst) def _generate_software(self): for name, src_dir in self.software_packages: -- 2.30.2