Merge tag 'bcachefs-2024-09-09' of git://evilpiepirate.org/bcachefs
[linux-2.6-block.git] / arch / x86 / tools / Makefile
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
ca0e9bad 2PHONY += posttest
d65ff75f 3
6ae4b986 4ifneq ($(findstring 1, $(KBUILD_VERBOSE)),)
80509e27 5 posttest_verbose = -v
d65ff75f 6else
80509e27
MH
7 posttest_verbose =
8endif
9
10ifeq ($(CONFIG_64BIT),y)
11 posttest_64bit = -y
12else
13 posttest_64bit = -n
d65ff75f
MH
14endif
15
98fe07fc 16reformatter = $(srctree)/arch/x86/tools/objdump_reformat.awk
6f5f6726
MH
17chkobjdump = $(srctree)/arch/x86/tools/chkobjdump.awk
18
ca0e9bad 19quiet_cmd_posttest = TEST $@
5225952d 20 cmd_posttest = $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(reformatter) | $(obj)/insn_decoder_test $(posttest_64bit) $(posttest_verbose)
ca0e9bad 21
1ec454ba
MH
22quiet_cmd_sanitytest = TEST $@
23 cmd_sanitytest = $(obj)/insn_sanity $(posttest_64bit) -m 1000000
24
6b63dd11 25posttest: $(obj)/insn_decoder_test vmlinux $(obj)/insn_sanity
ca0e9bad 26 $(call cmd,posttest)
1ec454ba 27 $(call cmd,sanitytest)
ca0e9bad 28
5f2fb52f 29hostprogs += insn_decoder_test insn_sanity
ca0e9bad
MH
30
31# -I needed for generated C source and C source which in the kernel tree.
c8d7b7e5 32HOSTCFLAGS_insn_decoder_test.o := -Wall -I$(srctree)/tools/arch/x86/lib/ -I$(srctree)/tools/arch/x86/include/ -I$(objtree)/arch/x86/lib/
ca0e9bad 33
c8d7b7e5 34HOSTCFLAGS_insn_sanity.o := -Wall -I$(srctree)/tools/arch/x86/lib/ -I$(srctree)/tools/arch/x86/include/ -I$(objtree)/arch/x86/lib/
1ec454ba 35
9bf4e7fb 36# Dependencies are also needed.
c8d7b7e5 37$(obj)/insn_decoder_test.o: $(srctree)/tools/arch/x86/lib/insn.c $(srctree)/tools/arch/x86/lib/inat.c $(srctree)/tools/arch/x86/include/asm/inat_types.h $(srctree)/tools/arch/x86/include/asm/inat.h $(srctree)/tools/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
ca0e9bad 38
c8d7b7e5 39$(obj)/insn_sanity.o: $(srctree)/tools/arch/x86/lib/insn.c $(srctree)/tools/arch/x86/lib/inat.c $(srctree)/tools/arch/x86/include/asm/inat_types.h $(srctree)/tools/arch/x86/include/asm/inat.h $(srctree)/tools/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
6520fe55
PA
40
41HOST_EXTRACFLAGS += -I$(srctree)/tools/include
5f2fb52f 42hostprogs += relocs
c889ba80 43relocs-objs := relocs_32.o relocs_64.o relocs_common.o
e6bcd1a8 44PHONY += relocs
c889ba80 45relocs: $(obj)/relocs
e6bcd1a8 46 @: