summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-10-14 11:14:18 +0300
committerAnup Patel <anup@brainfault.org>2020-10-18 07:44:17 +0300
commitaf4b50f896684040dd3f56f2fdcad702f527c633 (patch)
treef599fea23aee3be31e16564609e9f560fa0476e3 /Makefile
parenta04c46506a6e5bd7425bd63430645a6c85145b10 (diff)
downloadopensbi-af4b50f896684040dd3f56f2fdcad702f527c633.tar.xz
Makefile: Build ELF, BIN and LD script in platform build directory
Currently, the make rules for ELF, BIN and LD script are little generic to allowing ELF, BIN and LD script to be anywhere in the build directory. For OpenSBI firmwares, the ELF, BIN, and LD script are always platform specific so we update make rules accordingly. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 9 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 2a352ef..6c36f09 100644
--- a/Makefile
+++ b/Makefile
@@ -310,15 +310,6 @@ all: $(targets-y)
# Preserve all intermediate files
.SECONDARY:
-$(build_dir)/%.bin: $(build_dir)/%.elf
- $(call compile_objcopy,$@,$<)
-
-$(build_dir)/%.elf: $(build_dir)/%.o $(build_dir)/%.elf.ld $(platform_build_dir)/lib/libplatsbi.a
- $(call compile_elf,$@,$@.ld,$< $(platform_build_dir)/lib/libplatsbi.a)
-
-$(platform_build_dir)/%.ld: $(src_dir)/%.ldS
- $(call compile_cpp,$@,$<)
-
$(build_dir)/lib/libsbi.a: $(libsbi-objs-path-y)
$(call compile_ar,$@,$^)
@@ -340,6 +331,15 @@ $(build_dir)/%.dep: $(src_dir)/%.S
$(build_dir)/%.o: $(src_dir)/%.S
$(call compile_as,$@,$<)
+$(platform_build_dir)/%.bin: $(platform_build_dir)/%.elf
+ $(call compile_objcopy,$@,$<)
+
+$(platform_build_dir)/%.elf: $(platform_build_dir)/%.o $(platform_build_dir)/%.elf.ld $(platform_build_dir)/lib/libplatsbi.a
+ $(call compile_elf,$@,$@.ld,$< $(platform_build_dir)/lib/libplatsbi.a)
+
+$(platform_build_dir)/%.ld: $(src_dir)/%.ldS
+ $(call compile_cpp,$@,$<)
+
$(platform_build_dir)/%.dep: $(platform_src_dir)/%.c
$(call compile_cc_dep,$@,$<)