1 ################################################################################
5 ################################################################################
7 LINUX_TOOLS
+= selftests
9 ifeq ($(KERNEL_ARCH
),x86_64
)
12 ifeq ($(KERNEL_ARCH
),i386
)
15 SELFTESTS_ARCH
=$(KERNEL_ARCH
)
19 SELFTESTS_DEPENDENCIES
= libcap-ng popt
21 SELFTESTS_MAKE_FLAGS
= \
23 ARCH
=$(SELFTESTS_ARCH
)
25 # O must be redefined here to overwrite the one used by Buildroot for
26 # out of tree build. We build the selftests in $(LINUX_DIR)/tools/selftests and
27 # not just $(LINUX_DIR) so that it isn't built in the root directory of the kernel
30 # The headers_install step here is important as some kernel selftests use a
31 # hardcoded CFLAGS to find kernel headers e.g:
32 # CFLAGS += -I../../../../usr/include/
33 # The headers_install target will install the kernel headers locally inside
35 define SELFTESTS_BUILD_CMDS
36 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(LINUX_DIR
) $(SELFTESTS_MAKE_FLAGS
) \
38 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(LINUX_DIR
)/tools
/testing
/selftests \
39 $(SELFTESTS_MAKE_FLAGS
) O
=$(LINUX_DIR
)/tools
/testing
/selftests
42 define SELFTESTS_INSTALL_TARGET_CMDS
43 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(LINUX_DIR
)/tools
/testing
/selftests \
44 $(SELFTESTS_MAKE_FLAGS
) O
=$(LINUX_DIR
)/tools
/testing
/selftests \
45 INSTALL_PATH
=$(TARGET_DIR
)/usr
/lib
/kselftests
install