zephyr-helloworld: code clean up

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
This commit is contained in:
Naveen Saini
2019-12-02 19:08:48 +08:00
parent 4d518195da
commit c9feff3799
2 changed files with 9 additions and 10 deletions

View File

@@ -1,18 +1,13 @@
require zephyr-kernel.inc
require zephyr-kernel-common.inc
inherit cmake pkgconfig deploy
inherit deploy
ZEPHYR_SRC_DIR = "${S}/samples/hello_world"
ZEPHYR_BASE = "${S}"
OECMAKE_SOURCEPATH = "${ZEPHYR_SRC_DIR}"
DEPENDS += "gperf-native"
EXTRA_OECMAKE = " -DZEPHYR_BASE=${S} -DZEPHYR_GCC_VARIANT=yocto -DBOARD=${BOARD} -DARCH=${ARCH} -DCROSS_COMPILE=${CROSS_COMPILE} -DZEPHYR_SYSROOT=${ZEPHYR_SYSROOT} -DZEPHYR_TOOLCHAIN_VARIANT=yocto"
export ZEPHYR_BASE="${S}"
do_deploy () {
install -D ${B}/zephyr/zephyr.elf ${DEPLOYDIR}/${PN}.elf
install -D ${B}/zephyr/${ZEPHYR_MAKE_OUTPUT} ${DEPLOYDIR}/${PN}.elf
}
addtask deploy after do_compile

View File

@@ -1,6 +1,6 @@
# Common settings for all Zephyr recipes
ZEPHYR_INHERIT_CLASSES += "zephyr"
ZEPHYR_INHERIT_CLASSES += "zephyr cmake"
inherit ${ZEPHYR_INHERIT_CLASSES}
# There shouldn't be a manifest for zephyr kernels since there is no root
@@ -11,11 +11,15 @@ ZEPHYR_GCC_VARIANT="yocto"
ZEPHYR_SYSROOT="${STAGING_DIR_TARGET}"
ZEPHYR_MAKE_OUTPUT = "zephyr.elf"
ZEPHYR_MAKE_ARGS = " BOARD=${BOARD} ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} ZEPHYR_GCC_VARIANT=${ZEPHYR_GCC_VARIANT} ZEPHYR_BASE=${ZEPHYR_BASE} ZEPHYR_SYSROOT=${ZEPHYR_SYSROOT}"
EXTRA_OECMAKE = " -DZEPHYR_BASE=${S} -DZEPHYR_GCC_VARIANT=yocto -DBOARD=${BOARD} -DARCH=${ARCH} -DCROSS_COMPILE=${CROSS_COMPILE} -DZEPHYR_SYSROOT=${ZEPHYR_SYSROOT} -DZEPHYR_TOOLCHAIN_VARIANT=yocto"
export ZEPHYR_BASE="${S}"
# We always need a toolchain to cross-compile.
INHIBIT_DEFAULT_DEPS = "1"
DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc ${TOOLCHAIN_TARGET_TASK}"
DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc ${TOOLCHAIN_TARGET_TASK} gperf-native"
CROSS_COMPILE = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
DEPENDS_append_qemuall = " qemu-native qemu-helper-native"