rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #Basic Configuration |
| 2 | DESCRIPTION = "CCCI util kernel module." |
| 3 | SECTION = "base" |
| 4 | LICENSE = "MediaTekProprietary" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff" |
| 6 | DEPENDS = "custom lib64-modccci virtual/kernel" |
| 7 | MTK_SRC = "${BACH_SRC}/mod-ccci_util" |
| 8 | |
| 9 | WORKONSRC = "${MTK_SRC}" |
| 10 | BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_DIR_HOST}/usr/include/ccci" |
| 11 | BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_DIR_HOST}/usr/include/ccci" |
| 12 | |
| 13 | inherit deploy workonsrc |
| 14 | |
| 15 | #Parameters passed to do_compile() |
| 16 | EXTRA_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 | |
| 24 | FILES_${PN} = "/lib/modules" |
| 25 | |
| 26 | FILES_${PN}-dev = "${includedir}" |
| 27 | |
| 28 | #Skip strip check in QA test. |
| 29 | INSANE_SKIP_${PN} += "already-stripped" |
| 30 | |
| 31 | |
| 32 | do_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 | |
| 41 | do_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 | |
| 57 | addtask bachclean |
| 58 | do_bachclean () { |
| 59 | oe_runmake clean |
| 60 | } |