blob: 4ccfdd1d8ce9ba6c25ee6419859ae5163ff2a04c [file] [log] [blame]
Benjamin Fair44f6b4d2019-01-22 14:34:28 -08001require u-boot-common-nuvoton.inc
2
Tomer Maimondbd6fa12018-01-29 17:36:16 +02003SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
kwliu89ad9f32019-06-13 13:49:19 +08004DEPENDS = "mtd-utils bison-native"
Tomer Maimondbd6fa12018-01-29 17:36:16 +02005
6PROVIDES += "u-boot-fw-utils"
7
Willy Tuce3cb2c2021-08-10 15:28:25 -07008INSANE_SKIP:${PN} = "already-stripped"
Tomer Maimondbd6fa12018-01-29 17:36:16 +02009
Willy Tuce3cb2c2021-08-10 15:28:25 -070010EXTRA_OEMAKE:class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" HOSTCC="${BUILD_CC} ${BUILD_FLAGS} ${BUILD_LDFLAGS}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
11EXTRA_OEMAKE:class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
Tomer Maimondbd6fa12018-01-29 17:36:16 +020012
13inherit uboot-config
14
15do_compile () {
16 oe_runmake ${UBOOT_MACHINE}
kwliu89ad9f32019-06-13 13:49:19 +080017 oe_runmake envtools
Tomer Maimondbd6fa12018-01-29 17:36:16 +020018}
19
20do_install () {
21 install -d ${D}${base_sbindir}
22 install -d ${D}${sysconfdir}
23 install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
24 install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
25 install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
26}
27
Willy Tuce3cb2c2021-08-10 15:28:25 -070028do_install:class-cross () {
Tomer Maimondbd6fa12018-01-29 17:36:16 +020029 install -d ${D}${bindir_cross}
30 install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
31 install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
32}
33
Willy Tuce3cb2c2021-08-10 15:28:25 -070034SYSROOT_PREPROCESS_FUNCS:class-cross = "uboot_fw_utils_cross"
Tomer Maimondbd6fa12018-01-29 17:36:16 +020035uboot_fw_utils_cross() {
36 sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
37}
38
39PACKAGE_ARCH = "${MACHINE_ARCH}"
40BBCLASSEXTEND = "cross"