1SUMMARY = "barebox bootloader tools"
2
3require barebox-common.inc
4
5LICENSE = "GPL-2.0-only"
6
7DEPENDS = "bison-native flex-native libusb1"
8
9S = "${WORKDIR}/barebox-${PV}"
10B = "${WORKDIR}/build"
11
12inherit pkgconfig
13
14EXTRA_OEMAKE = " \
15  ARCH=sandbox \
16  CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \
17  CROSS_PKG_CONFIG=pkg-config \
18  CC='${CC}' \
19  LD='${LD}' \
20  "
21
22do_compile:class-target () {
23    export userccflags="${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
24    export userldflags="${TARGET_LDFLAGS}${TOOLCHAIN_OPTIONS}"
25    oe_runmake targettools_defconfig
26    oe_runmake scripts
27}
28
29do_compile:class-native () {
30    oe_runmake hosttools_defconfig
31    oe_runmake scripts
32}
33
34BAREBOX_TOOLS = " \
35         bareboxenv \
36         bareboxcrc32 \
37         kernel-install \
38         bareboximd \
39         omap3-usb-loader \
40         omap4_usbboot \
41         imx/imx-usb-loader \
42         "
43
44BAREBOX_TOOLS_SUFFIX = ""
45BAREBOX_TOOLS_SUFFIX:class-target = "-target"
46
47do_install () {
48	install -d ${D}${bindir}
49
50	for tool in ${BAREBOX_TOOLS}; do
51		install -m 0755 scripts/${tool}${BAREBOX_TOOLS_SUFFIX} ${D}${bindir}/${tool##*/}
52	done
53}
54
55BBCLASSEXTEND = "native nativesdk"
56