xref: /linux/arch/riscv/Makefile.postlink (revision fd8c09ad0d87783b9b6a27900d66293be45b7bad)
1# SPDX-License-Identifier: GPL-2.0
2# ===========================================================================
3# Post-link riscv pass
4# ===========================================================================
5#
6# Check that vmlinux relocations look sane
7
8PHONY := __archpost
9__archpost:
10
11-include include/config/auto.conf
12include $(srctree)/scripts/Kbuild.include
13include $(srctree)/scripts/Makefile.lib
14
15quiet_cmd_relocs_check = CHKREL  $@
16cmd_relocs_check = 							\
17	$(CONFIG_SHELL) $(srctree)/arch/riscv/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@"
18
19ifdef CONFIG_RELOCATABLE
20quiet_cmd_cp_vmlinux_relocs = CPREL   vmlinux.relocs
21cmd_cp_vmlinux_relocs = cp vmlinux vmlinux.relocs
22
23endif
24
25# `@true` prevents complaint when there is nothing to be done
26
27vmlinux: FORCE
28	@true
29ifdef CONFIG_RELOCATABLE
30	$(call if_changed,relocs_check)
31	$(call if_changed,cp_vmlinux_relocs)
32	$(call if_changed,strip_relocs)
33endif
34
35clean:
36	@true
37
38PHONY += FORCE clean
39
40FORCE:
41
42.PHONY: $(PHONY)
43