linenoise: add .hash file
[buildroot-gz.git] / linux / linux-tool-selftests.mk
blob3cbfed2d810da30e4e0dd13804e86f47775afcbe
1 ################################################################################
3 # selftests
5 ################################################################################
7 LINUX_TOOLS += selftests
9 ifeq ($(KERNEL_ARCH),x86_64)
10 SELFTESTS_ARCH=x86
11 else
12 ifeq ($(KERNEL_ARCH),i386)
13 SELFTESTS_ARCH=x86
14 else
15 SELFTESTS_ARCH=$(KERNEL_ARCH)
16 endif
17 endif
19 SELFTESTS_DEPENDENCIES = libcap-ng popt
21 SELFTESTS_MAKE_FLAGS = \
22 $(LINUX_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 $(@D)/tools/selftests and
27 # not just $(@D) so that it isn't built in the root directory of the kernel
28 # sources.
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
34 # the Linux build dir
35 define SELFTESTS_BUILD_CMDS
36 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) $(SELFTESTS_MAKE_FLAGS) \
37 headers_install
38 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/tools/testing/selftests \
39 $(SELFTESTS_MAKE_FLAGS) O=$(@D)/tools/testing/selftests
40 endef
42 define SELFTESTS_INSTALL_TARGET_CMDS
43 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/tools/testing/selftests \
44 $(SELFTESTS_MAKE_FLAGS) O=$(@D)/tools/testing/selftests \
45 INSTALL_PATH=$(TARGET_DIR)/usr/lib/kselftests install
46 endef