summaryrefslogtreecommitdiff
path: root/recipes-devtools/spidev-test/spidev-test.bb
blob: 2c403e6318412dc53eded6447f6cc37bb6cd7cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
COMPATIBLE_MACHINE = "(colibri-vf)"

SUMMARY = "The Linux kernels spidev-test programm"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"

PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}"

do_configure[depends] += "virtual/kernel:do_shared_workdir"
do_populate_lic[depends] += "virtual/kernel:do_shared_workdir"

# the spidev_test.c example got moved to tools/spi/ starting with
# the v.4.5.y kernel
KERNELPATH = "tools/spi/spidev_test.c"
KERNELPATH-OLD = "Documentation/spi/spidev_test.c"

do_compile () {
    if [ -f "${STAGING_KERNEL_DIR}/${KERNELPATH}" ]
    then
        ${CC} ${LDFLAGS} ${STAGING_KERNEL_DIR}/${KERNELPATH} -o spidev_test
    else
        ${CC} ${LDFLAGS} ${STAGING_KERNEL_DIR}/${KERNELPATH-OLD} -o spidev_test
    fi
}

do_install () {
    install -d ${D}${bindir}
    install -m 0755 ${S}/spidev_test ${D}${bindir}/
}