summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mtac-xdot_1.1.1.bb
blob: dc12bba21f17bf323b612940467909b2f7bd68d1 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
DESCRIPTION = "MTAC XDOT (LoRa) Card"
HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-xdot/"
SECTION = "base"
PRIORITY = "optional"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
do_fetch[depends]+="virtual/kernel:do_shared_workdir"
DEPENDS = "virtual/kernel mtac mts-io"
RDEPENDS_${PN} = "kernel-module-mtac"
INC_PR = "r3"
COMPATIBLE_MACHINE = "(mtcdt|mtcpmhs)"

SRCREV = "${PV}"

PR = "${INC_PR}.1"

PKGR = "${PR}${KERNEL_MODULE_PACKAGE_SUFFIX}${EXTENDPRAUTO}"

SRC_URI = " \
    git://git.multitech.net/mtac-xdot.git;protocol=git;branch=master \
    file://xdot-util \
"
S = "${WORKDIR}/git"

inherit module

MTS_EXTRA_SYMBOLS="${STAGING_INCDIR}/mts-io/Module.symvers \
                   ${STAGING_INCDIR}/mtac/Module.symvers"

COMMON_OEMAKE = " -C ${STAGING_KERNEL_DIR} \
                KBUILD_VERBOSE=1 \
                KBUILD_EXTRA_SYMBOLS='${MTS_EXTRA_SYMBOLS}' \
                M=${S} \
                modules \
                "

EXTRA_OEMAKE_mtcdt = "${COMMON_OEMAKE} EXTRA_CFLAGS='-I${STAGING_INCDIR}/mts-kernel-headers \
                                    -D SAM9G25'"
EXTRA_OEMAKE_mtcpmhs = "${COMMON_OEMAKE} EXTRA_CFLAGS='-I${STAGING_INCDIR}/mts-kernel-headers \
                                    -D TI43X -D CONFIG_MTS_NUM_ACCESSORY_PORTS=2'"


do_compile () {
    bbnote make   "$@"
    make   "$@"
    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
    oe_runmake
}


PACKAGES = "kernel-module-${PN} ${PN}-util"

FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_xdot.ko"

FILES_${PN}-util += "${sbindir}/xdot-util"

PARALLEL_MAKE = ""

fakeroot do_install () {
    install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra
    # use cp instead of install so the driver doesn't get stripped
    cp ${S}/mtac_xdot.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra

    install -m 0755 -d ${D}${sbindir}
    install -m 0755 ${WORKDIR}/xdot-util ${D}${sbindir}/xdot-util
}