summaryrefslogtreecommitdiff
path: root/arch/riscv/Makefile.postlink
blob: 6b0580949b6a24ff34ea52518c37bf162dc4606a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# SPDX-License-Identifier: GPL-2.0
# ===========================================================================
# Post-link riscv pass
# ===========================================================================
#
# Check that vmlinux relocations look sane

PHONY := __archpost
__archpost:

-include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
include $(srctree)/scripts/Makefile.lib

quiet_cmd_relocs_check = CHKREL  $@
cmd_relocs_check = 							\
	$(CONFIG_SHELL) $(srctree)/arch/riscv/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@"

ifdef CONFIG_RELOCATABLE
quiet_cmd_cp_vmlinux_relocs = CPREL   vmlinux.relocs
cmd_cp_vmlinux_relocs = cp vmlinux vmlinux.relocs

endif

# `@true` prevents complaint when there is nothing to be done

vmlinux: FORCE
	@true
ifdef CONFIG_RELOCATABLE
	$(call if_changed,relocs_check)
	$(call if_changed,cp_vmlinux_relocs)
	$(call if_changed,strip_relocs)
endif

clean:
	@true

PHONY += FORCE clean

FORCE:

.PHONY: $(PHONY)