blob: b6389010416a2acda380ef262478049e566f39dc [file] [log] [blame]
#Basic Configuration
DESCRIPTION = "CCCI util kernel module."
SECTION = "base"
LICENSE = "MediaTekProprietary"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
DEPENDS = "custom lib64-modccci virtual/kernel"
MTK_SRC = "${BACH_SRC}/mod-ccci_util"
WORKONSRC = "${MTK_SRC}"
BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_DIR_HOST}/usr/include/ccci"
BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_DIR_HOST}/usr/include/ccci"
inherit deploy workonsrc
#Parameters passed to do_compile()
EXTRA_OEMAKE += "'CROSS=${TARGET_PREFIX}'\
'PREFIX=${BACH_PREFIX}'\
'PACKAGE_ARCH=${PACKAGE_ARCH}'\
'SYSROOT=${STAGING_DIR_HOST}'\
'ARCH=${KERNEL_ARCH}'\
'KERNELDIR=${KERNEL_OUT_DIR}'\
'CONFIG=${BB_LDFLAGS_ADD}'"
FILES_${PN} = "/lib/modules"
FILES_${PN}-dev = "${includedir}"
#Skip strip check in QA test.
INSANE_SKIP_${PN} += "already-stripped"
do_compile () {
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
if [ "${APSIM}" = "YES" ]; then
oe_runmake KBUILD_EXTRA_INCLUDE=${STAGING_INCDIR} CONFIG="${BB_INCLUDE_ADD} -DCONFIG_APSIM" PROJECT=mt6293_mifi PLATFORM_CHIP=MT6293 PLATFORM=mt6293
else
oe_runmake KBUILD_EXTRA_INCLUDE=${STAGING_INCDIR} CONFIG="${BB_INCLUDE_ADD}"
fi
}
do_install () {
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
if [ "${APSIM}" = "YES" ]; then
oe_runmake install SYSROOT=${D} KBUILD_EXTRA_INCLUDE=${D}/include CONFIG="${BB_LDFLAGS_ADD} -DCONFIG_APSIM" PROJECT=mt6293_mifi PLATFORM_CHIP=MT6293 PLATFORM=mt6293
else
oe_runmake install SYSROOT=${D} KBUILD_EXTRA_INCLUDE=${D}/include CONFIG="${BB_LDFLAGS_ADD}"
fi
find ${D} -name "modules.*" -exec rm -f '{}' \;
if [ -d "${D}/include" ]; then
install -d ${D}${includedir}
cp -af ${D}/include/* ${D}${includedir}
rm -rf ${D}/include
fi
}
addtask bachclean
do_bachclean () {
oe_runmake clean
}