Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # SPDX-License-Identifier: GPL-2.0
  2. PHONY += posttest
  3. ifeq ($(KBUILD_VERBOSE),1)
  4. posttest_verbose = -v
  5. else
  6. posttest_verbose =
  7. endif
  8. ifeq ($(CONFIG_64BIT),y)
  9. posttest_64bit = -y
  10. else
  11. posttest_64bit = -n
  12. endif
  13. reformatter = $(srctree)/arch/x86/tools/objdump_reformat.awk
  14. chkobjdump = $(srctree)/arch/x86/tools/chkobjdump.awk
  15. quiet_cmd_posttest = TEST $@
  16. cmd_posttest = ($(OBJDUMP) -v | $(AWK) -f $(chkobjdump)) || $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(reformatter) | $(obj)/insn_decoder_test $(posttest_64bit) $(posttest_verbose)
  17. quiet_cmd_sanitytest = TEST $@
  18. cmd_sanitytest = $(obj)/insn_sanity $(posttest_64bit) -m 1000000
  19. posttest: $(obj)/insn_decoder_test vmlinux $(obj)/insn_sanity
  20. $(call cmd,posttest)
  21. $(call cmd,sanitytest)
  22. hostprogs-y += insn_decoder_test insn_sanity
  23. # -I needed for generated C source and C source which in the kernel tree.
  24. HOSTCFLAGS_insn_decoder_test.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/uapi/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/uapi/
  25. HOSTCFLAGS_insn_sanity.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
  26. # Dependencies are also needed.
  27. $(obj)/insn_decoder_test.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
  28. $(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
  29. HOST_EXTRACFLAGS += -I$(srctree)/tools/include
  30. hostprogs-y += relocs
  31. relocs-objs := relocs_32.o relocs_64.o relocs_common.o
  32. PHONY += relocs
  33. relocs: $(obj)/relocs
  34. @: