diff options
Diffstat (limited to 'meta-renesas-extras/classes/renesas-module.bbclass')
-rw-r--r-- | meta-renesas-extras/classes/renesas-module.bbclass | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/meta-renesas-extras/classes/renesas-module.bbclass b/meta-renesas-extras/classes/renesas-module.bbclass new file mode 100644 index 0000000..49ccc51 --- /dev/null +++ b/meta-renesas-extras/classes/renesas-module.bbclass | |||
@@ -0,0 +1,71 @@ | |||
1 | ############################################################################## | ||
2 | ## | ||
3 | ## Copyright (C) 2016 The Qt Company Ltd. | ||
4 | ## Contact: http://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:COMM$ | ||
9 | ## | ||
10 | ## Commercial License Usage | ||
11 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
12 | ## accordance with the commercial license agreement provided with the | ||
13 | ## Software or, alternatively, in accordance with the terms contained in | ||
14 | ## a written agreement between you and The Qt Company. For licensing terms | ||
15 | ## and conditions see http://www.qt.io/terms-conditions. For further | ||
16 | ## information use the contact form at http://www.qt.io/contact-us. | ||
17 | ## | ||
18 | ## $QT_END_LICENSE$ | ||
19 | ## | ||
20 | ############################################################################## | ||
21 | |||
22 | ### Unfortunately the kernel module recipes in meta-renesas/meta-rcar-gen2 | ||
23 | ### are fairly broken, as they tend to install their include files into the | ||
24 | ### staging area. That breaks when recompiling the kernel and is just flaky | ||
25 | ### in general. Try to make things work reliably. | ||
26 | |||
27 | inherit module | ||
28 | addtask shared_workdir after do_compile | ||
29 | |||
30 | EXTRA_OEMAKE += "ARCH=${ARCH}" | ||
31 | |||
32 | export BUILDDIR = "${STAGING_DIR_HOST}" | ||
33 | export LIBSHARED = "${STAGING_LIBDIR}" | ||
34 | export KERNELSRC = "${STAGING_KERNEL_DIR}" | ||
35 | export CROSS_COMPILE = "${TARGET_PREFIX}" | ||
36 | export KERNELDIR = "${STAGING_KERNEL_BUILDDIR}" | ||
37 | export LDFLAGS = "" | ||
38 | export CP = "cp" | ||
39 | |||
40 | MODULE_SOURCE_DIR ?= "${S}/drv/" | ||
41 | |||
42 | do_compile() { | ||
43 | cd ${MODULE_SOURCE_DIR} | ||
44 | module_do_compile | ||
45 | cd - | ||
46 | } | ||
47 | |||
48 | deploy_build_deps() { | ||
49 | targetdir="$1" | ||
50 | |||
51 | install -d ${targetdir}/include | ||
52 | install ${MODULE_SOURCE_DIR}/Module.symvers $targetdir/include/${MODULE_NAME}.symvers | ||
53 | |||
54 | for header in ${MODULE_HEADERS} ; do | ||
55 | install -t ${targetdir}/include ${S}/${header} | ||
56 | done | ||
57 | } | ||
58 | |||
59 | do_shared_workdir () { | ||
60 | deploy_build_deps ${STAGING_KERNEL_BUILDDIR} | ||
61 | } | ||
62 | |||
63 | do_install() { | ||
64 | install -D ${MODULE_SOURCE_DIR}/${MODULE_NAME}${KERNEL_OBJECT_SUFFIX} ${D}/lib/modules/${KERNEL_VERSION}/extra/${MODULE_NAME}${KERNEL_OBJECT_SUFFIX} | ||
65 | deploy_build_deps ${D}/usr/src/kernel | ||
66 | } | ||
67 | |||
68 | FILES_${PN}-dev = " \ | ||
69 | /usr/src/kernel/include/${MODULE_NAME}.symvers \ | ||
70 | /usr/src/kernel/include/*.h \ | ||
71 | " | ||