blob: f82082677337e8fc769ebdef16e747e4b6ce00ba [file] [log] [blame]
Masami Hiramatsuca0e9ba2009-08-13 16:34:21 -04001PHONY += posttest
Masami Hiramatsud65ff752009-11-16 18:06:18 -05002
3ifeq ($(KBUILD_VERBOSE),1)
Masami Hiramatsu80509e22009-11-20 12:13:08 -05004 posttest_verbose = -v
Masami Hiramatsud65ff752009-11-16 18:06:18 -05005else
Masami Hiramatsu80509e22009-11-20 12:13:08 -05006 posttest_verbose =
7endif
8
9ifeq ($(CONFIG_64BIT),y)
10 posttest_64bit = -y
11else
12 posttest_64bit = -n
Masami Hiramatsud65ff752009-11-16 18:06:18 -050013endif
14
Masami Hiramatsu6f5f6722009-11-20 12:13:14 -050015distill_awk = $(srctree)/arch/x86/tools/distill.awk
16chkobjdump = $(srctree)/arch/x86/tools/chkobjdump.awk
17
Masami Hiramatsuca0e9ba2009-08-13 16:34:21 -040018quiet_cmd_posttest = TEST $@
Masami Hiramatsu6f5f6722009-11-20 12:13:14 -050019 cmd_posttest = ($(OBJDUMP) -v | $(AWK) -f $(chkobjdump)) || $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(distill_awk) | $(obj)/test_get_len $(posttest_64bit) $(posttest_verbose)
Masami Hiramatsuca0e9ba2009-08-13 16:34:21 -040020
21posttest: $(obj)/test_get_len vmlinux
22 $(call cmd,posttest)
23
24hostprogs-y := test_get_len
25
26# -I needed for generated C source and C source which in the kernel tree.
Ingo Molnar9bf4e7f2009-10-21 14:39:51 +020027HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
Masami Hiramatsuca0e9ba2009-08-13 16:34:21 -040028
Ingo Molnar9bf4e7f2009-10-21 14:39:51 +020029# Dependencies are also needed.
Masami Hiramatsuca0e9ba2009-08-13 16:34:21 -040030$(obj)/test_get_len.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
31