From 3275304a7fde4201841b76ec970590fc0ba6f376 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Mon, 9 Aug 2021 09:49:03 +1000 Subject: [PATCH] litedram: Remove variables.mak Instead of creating variables.mak, just pass the variables in on the make command line. Signed-off-by: Anton Blanchard --- litedram/gen-src/generate.py | 18 +++++++++--------- litedram/gen-src/sdram_init/Makefile | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/litedram/gen-src/generate.py b/litedram/gen-src/generate.py index eb677a8..2e13b0e 100755 --- a/litedram/gen-src/generate.py +++ b/litedram/gen-src/generate.py @@ -1,6 +1,5 @@ #!/usr/bin/python3 -from fusesoc.capi2.generator import Generator from litex.build.tools import write_to_file from litex.build.tools import replace_in_file from litex.build.generic_platform import * @@ -55,18 +54,19 @@ def build_init_code(build_dir, is_sim): def add_var(k, v): env_vars.append("{}={}\n".format(k, _makefile_escape(v))) - add_var("BUILD_DIR", sw_dir) - add_var("SRC_DIR", src_dir) - add_var("GENINC_DIR", sw_inc_dir) - add_var("LXSRC_DIR", lxbios_src_dir) + makefile = os.path.join(src_dir, "Makefile") + cmd = ["make", "-C", build_dir, "-f", makefile] + cmd.append("BUILD_DIR=%s" % sw_dir) + cmd.append("SRC_DIR=%s" % src_dir) + cmd.append("GENINC_DIR=%s" % sw_inc_dir) + cmd.append("LXSRC_DIR=%s" % lxbios_src_dir) + if is_sim: - add_var("EXTRA_CFLAGS", "-D__SIM__") - write_to_file(os.path.join(gen_inc_dir, "variables.mak"), "".join(env_vars)) + cmd.append("EXTRA_CFLAGS=%s" % "-D__SIM__") # Build init code print(" Generating init software...") - makefile = os.path.join(src_dir, "Makefile") - r = subprocess.check_call(["make", "-C", build_dir, "-I", gen_inc_dir, "-f", makefile]) + r = subprocess.check_call(cmd) print("Make result:", r) return os.path.join(sw_dir, "obj", "sdram_init.hex") diff --git a/litedram/gen-src/sdram_init/Makefile b/litedram/gen-src/sdram_init/Makefile index 2e622d4..662cc26 100644 --- a/litedram/gen-src/sdram_init/Makefile +++ b/litedram/gen-src/sdram_init/Makefile @@ -1,6 +1,5 @@ #### Directories -include variables.mak OBJ = $(BUILD_DIR)/obj LXINC_DIR=$(LXSRC_DIR)/include -- 2.30.2