blob: b6389010416a2acda380ef262478049e566f39dc [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#Basic Configuration
2DESCRIPTION = "CCCI util kernel module."
3SECTION = "base"
4LICENSE = "MediaTekProprietary"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
6DEPENDS = "custom lib64-modccci virtual/kernel"
7MTK_SRC = "${BACH_SRC}/mod-ccci_util"
8
9WORKONSRC = "${MTK_SRC}"
10BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_DIR_HOST}/usr/include/ccci"
11BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_DIR_HOST}/usr/include/ccci"
12
13inherit deploy workonsrc
14
15#Parameters passed to do_compile()
16EXTRA_OEMAKE += "'CROSS=${TARGET_PREFIX}'\
17 'PREFIX=${BACH_PREFIX}'\
18 'PACKAGE_ARCH=${PACKAGE_ARCH}'\
19 'SYSROOT=${STAGING_DIR_HOST}'\
20 'ARCH=${KERNEL_ARCH}'\
21 'KERNELDIR=${KERNEL_OUT_DIR}'\
22 'CONFIG=${BB_LDFLAGS_ADD}'"
23
24FILES_${PN} = "/lib/modules"
25
26FILES_${PN}-dev = "${includedir}"
27
28#Skip strip check in QA test.
29INSANE_SKIP_${PN} += "already-stripped"
30
31
32do_compile () {
33 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
34 if [ "${APSIM}" = "YES" ]; then
35 oe_runmake KBUILD_EXTRA_INCLUDE=${STAGING_INCDIR} CONFIG="${BB_INCLUDE_ADD} -DCONFIG_APSIM" PROJECT=mt6293_mifi PLATFORM_CHIP=MT6293 PLATFORM=mt6293
36 else
37 oe_runmake KBUILD_EXTRA_INCLUDE=${STAGING_INCDIR} CONFIG="${BB_INCLUDE_ADD}"
38 fi
39}
40
41do_install () {
42 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
43 if [ "${APSIM}" = "YES" ]; then
44 oe_runmake install SYSROOT=${D} KBUILD_EXTRA_INCLUDE=${D}/include CONFIG="${BB_LDFLAGS_ADD} -DCONFIG_APSIM" PROJECT=mt6293_mifi PLATFORM_CHIP=MT6293 PLATFORM=mt6293
45 else
46 oe_runmake install SYSROOT=${D} KBUILD_EXTRA_INCLUDE=${D}/include CONFIG="${BB_LDFLAGS_ADD}"
47 fi
48 find ${D} -name "modules.*" -exec rm -f '{}' \;
49
50 if [ -d "${D}/include" ]; then
51 install -d ${D}${includedir}
52 cp -af ${D}/include/* ${D}${includedir}
53 rm -rf ${D}/include
54 fi
55}
56
57addtask bachclean
58do_bachclean () {
59 oe_runmake clean
60}