1 ################################################################################
5 ################################################################################
7 # v3.15+ requires SPI_TX_QUAD/SPI_RX_QUAD to build
8 # Normally kernel headers can't be newer than kernel so switch based on that.
9 # If you need quad-pumped spi support you need to upgrade your toolchain.
10 ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
),y
)
11 SPIDEV_TEST_VERSION
= v3.15
13 SPIDEV_TEST_VERSION
= v3.0
15 SPIDEV_TEST_SITE
= http
://git.kernel.org
/cgit
/linux
/kernel
/git
/torvalds
/linux.git
/plain
/Documentation
/spi
16 SPIDEV_TEST_SOURCE
= spidev_test.c?id
=$(SPIDEV_TEST_VERSION
)
17 SPIDEV_TEST_LICENSE
= GPLv2
19 # musl libc requires linux/ioctl.h for _IOC_SIZEBITS. Do a sed patch to keep
20 # compatibility with different spidev_test.c versions that we support.
21 define SPIDEV_ADD_LINUX_IOCTL
22 $(SED
) 's~^#include <sys/ioctl.h>~#include <sys/ioctl.h>\n#include <linux/ioctl.h>~' \
26 SPIDEV_TEST_POST_PATCH_HOOKS
+= SPIDEV_ADD_LINUX_IOCTL
28 define SPIDEV_TEST_EXTRACT_CMDS
29 cp
$(BR2_DL_DIR
)/$(SPIDEV_TEST_SOURCE
) $(@D
)/spidev_test.c
32 define SPIDEV_TEST_BUILD_CMDS
33 $(TARGET_MAKE_ENV
) $(TARGET_CC
) $(TARGET_CFLAGS
) \
34 -o
$(@D
)/spidev_test
$(@D
)/spidev_test.c
37 define SPIDEV_TEST_INSTALL_TARGET_CMDS
38 $(INSTALL
) -D
-m
755 $(@D
)/spidev_test \
39 $(TARGET_DIR
)/usr
/sbin
/spidev_test
42 $(eval
$(generic-package
))