blob: c67fb5f5f9dac1d13a74fe66d4e4265bb9423df8 [file] [log] [blame]
Andrew Geissler84ad7c52020-06-27 00:00:16 -05001inherit esw deploy
2
3ESW_COMPONENT_SRC = "/lib/sw_apps/hello_world/src/"
4
5DEPENDS += "dtc-native python3-dtc-native libxil xiltimer device-tree"
6
7inherit python3native
8
9do_configure_prepend() {
10 cd ${S}
11 nativepython3 ${S}/scripts/linker_gen.py -d ${DTBFILE} -o ${OECMAKE_SOURCEPATH}
12}
13
14do_install() {
15 install -d ${D}/${base_libdir}/firmware
16 # Note that we have to make the ELF executable for it to be stripped
17 install -m 0755 ${B}/hello_world* ${D}/${base_libdir}/firmware
18}
19
20HELLO_WORLD_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
21HELLO_WORLD_BASE_NAME[vardepsexclude] = "DATETIME"
22
23do_deploy() {
24
25 # We need to deploy the stripped elf, hence why not doing it from ${D}
26 install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/hello_world.elf ${DEPLOYDIR}/${HELLO_WORLD_BASE_NAME}.elf
27 ln -sf ${HELLO_WORLD_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
28 ${OBJCOPY} -O binary ${WORKDIR}/package/${base_libdir}/firmware/hello_world.elf ${WORKDIR}/package/${base_libdir}/firmware/hello_world.bin
29 install -m 0644 ${WORKDIR}/package/${base_libdir}/firmware/hello_world.bin ${DEPLOYDIR}/${HELLO_WORLD_BASE_NAME}.bin
30 ln -sf ${HELLO_WORLD_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
31}
32
33addtask deploy before do_build after do_package
34
35FILES_${PN} = "${base_libdir}/firmware/hello_world*"