rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | inherit deploy externalsrc |
| 2 | |
| 3 | LICENSE = "MediaTekProprietary" |
| 4 | MTK_SRC = "${TOPDIR}/../src/bsp/preloader" |
| 5 | LIC_FILES_CHKSUM = "file://${MTK_SRC}/README;md5=661d538ca8a7b4b17d03d6e90e384ffa" |
| 6 | PRELOADER_OUT = "${WORKDIR}/out" |
| 7 | CROSS_COMPILE = "${TARGET_PREFIX}" |
| 8 | EXTERNALSRC = "${MTK_SRC}" |
| 9 | EXTERNALSRC_BUILD = "${MTK_SRC}" |
| 10 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 11 | PRELOADER_BINARY = "preloader_${PRELOADER_PROJECT}.bin" |
| 12 | PRELOADER_IMAGE = "preloader.img" |
| 13 | PRELOADER_NOR_IMAGE = "preloader_nor.img" |
| 14 | |
| 15 | do_compile () { |
| 16 | oe_runmake MTK_PROJECT=${PRELOADER_PROJECT} \ |
| 17 | PRELOADER_OUT=${PRELOADER_OUT} \ |
| 18 | CROSS_COMPILE=${CROSS_COMPILE} \ |
| 19 | PRELOADER_BINARY=${PRELOADER_BINARY} \ |
| 20 | PRELOADER_PROJECT=${PRELOADER_PROJECT} |
| 21 | python ${MTK_SRC}/tools/gen-preloader-img.py \ |
| 22 | ${PRELOADER_OUT}/bin/${PRELOADER_BINARY} \ |
| 23 | ${PRELOADER_OUT}/bin/${PRELOADER_IMAGE} |
| 24 | python ${MTK_SRC}/tools/gen-sf-preloader-img.py \ |
| 25 | ${PRELOADER_OUT}/bin/${PRELOADER_BINARY} \ |
| 26 | ${PRELOADER_OUT}/bin/${PRELOADER_NOR_IMAGE} |
| 27 | } |
| 28 | |
| 29 | |
| 30 | do_buildclean () { |
| 31 | oe_runmake MTK_PROJECT=${PRELOADER_PROJECT} \ |
| 32 | PRELOADER_OUT=${PRELOADER_OUT} \ |
| 33 | CROSS_COMPILE=${CROSS_COMPILE} \ |
| 34 | PRELOADER_BINARY=${PRELOADER_BINARY} \ |
| 35 | PRELOADER_PROJECT=${PRELOADER_PROJECT} clean |
| 36 | } |
| 37 | |
| 38 | do_deploy () { |
| 39 | install -d ${DEPLOYDIR} |
| 40 | install ${PRELOADER_OUT}/bin/${PRELOADER_BINARY} ${DEPLOYDIR}/${PRELOADER_BINARY} |
| 41 | ln -nfs ${PRELOADER_BINARY} ${DEPLOYDIR}/preloader.bin |
| 42 | install ${PRELOADER_OUT}/bin/${PRELOADER_IMAGE} ${DEPLOYDIR}/${PRELOADER_IMAGE} |
| 43 | install ${PRELOADER_OUT}/bin/${PRELOADER_NOR_IMAGE} ${DEPLOYDIR}/${PRELOADER_NOR_IMAGE} |
| 44 | } |
| 45 | |
| 46 | addtask deploy before do_build after do_compile |