python-cryptography: bump to version 1.7.2
[buildroot-gz.git] / package / uboot-tools / uboot-tools.mk
blobfe363e7e78a5eb359b78e50f300cde8fb10dc543
1 ################################################################################
3 # uboot-tools
5 ################################################################################
7 UBOOT_TOOLS_VERSION = 2017.01
8 UBOOT_TOOLS_SOURCE = u-boot-$(UBOOT_TOOLS_VERSION).tar.bz2
9 UBOOT_TOOLS_SITE = ftp://ftp.denx.de/pub/u-boot
10 UBOOT_TOOLS_LICENSE = GPLv2+
11 UBOOT_TOOLS_LICENSE_FILES = Licenses/gpl-2.0.txt
12 UBOOT_TOOLS_INSTALL_STAGING = YES
14 define UBOOT_TOOLS_CONFIGURE_CMDS
15 mkdir -p $(@D)/include/config
16 touch $(@D)/include/config/auto.conf
17 endef
19 UBOOT_TOOLS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)" \
20 CFLAGS="$(TARGET_CFLAGS)" \
21 LDFLAGS="$(TARGET_LDFLAGS)" \
22 STRIP=$(TARGET_STRIP)
24 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
25 UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
26 UBOOT_TOOLS_DEPENDENCIES += dtc
27 endif
29 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
30 UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
31 UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
32 endif
34 define UBOOT_TOOLS_BUILD_CMDS
35 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) \
36 CROSS_BUILD_TOOLS=y tools-only
37 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) \
38 env no-dot-config-targets=env
39 endef
41 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
42 define UBOOT_TOOLS_INSTALL_MKIMAGE
43 $(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
44 endef
45 endif
47 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
48 define UBOOT_TOOLS_INSTALL_MKENVIMAGE
49 $(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(TARGET_DIR)/usr/bin/mkenvimage
50 endef
51 endif
53 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV),y)
54 define UBOOT_TOOLS_INSTALL_FWPRINTENV
55 $(INSTALL) -m 0755 -D $(@D)/tools/env/fw_printenv $(TARGET_DIR)/usr/sbin/fw_printenv
56 ln -sf fw_printenv $(TARGET_DIR)/usr/sbin/fw_setenv
57 endef
58 endif
60 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE),y)
61 define UBOOT_TOOLS_INSTALL_DUMPIMAGE
62 $(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(TARGET_DIR)/usr/sbin/dumpimage
63 endef
64 endif
66 define UBOOT_TOOLS_INSTALL_LIBUBOOTENV
67 endef
69 define UBOOT_TOOLS_INSTALL_STAGING_CMDS
70 $(INSTALL) -D -m 0755 $(@D)/tools/env/lib.a $(STAGING_DIR)/usr/lib/libubootenv.a
71 $(INSTALL) -D -m 0644 $(@D)/tools/env/fw_env.h $(STAGING_DIR)/usr/include/fw_env.h
72 endef
74 define UBOOT_TOOLS_INSTALL_TARGET_CMDS
75 $(UBOOT_TOOLS_INSTALL_MKIMAGE)
76 $(UBOOT_TOOLS_INSTALL_MKENVIMAGE)
77 $(UBOOT_TOOLS_INSTALL_FWPRINTENV)
78 $(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
79 endef
81 define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
82 mkdir -p $(@D)/include/config
83 touch $(@D)/include/config/auto.conf
84 endef
86 HOST_UBOOT_TOOLS_MAKE_OPTS = HOSTCC="$(HOSTCC)" \
87 HOSTCFLAGS="$(HOST_CFLAGS)" \
88 HOSTLDFLAGS="$(HOST_LDFLAGS)"
90 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
91 HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
92 HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
93 endif
95 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
96 HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
97 HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
98 endif
100 define HOST_UBOOT_TOOLS_BUILD_CMDS
101 $(MAKE1) -C $(@D) $(HOST_UBOOT_TOOLS_MAKE_OPTS) tools-only
102 endef
104 define HOST_UBOOT_TOOLS_INSTALL_CMDS
105 $(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/usr/bin/mkimage
106 $(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/usr/bin/mkenvimage
107 $(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/usr/bin/dumpimage
108 endef
110 $(eval $(generic-package))
111 $(eval $(host-generic-package))
113 # Convenience variables for other mk files that make use of mkimage
115 MKIMAGE = $(HOST_DIR)/usr/bin/mkimage
117 # mkimage supports arm blackfin m68k microblaze mips mips64 nios2 powerpc ppc sh sparc sparc64 x86
118 # KERNEL_ARCH can be arm64 arc arm blackfin m68k microblaze mips nios2 powerpc sh sparc i386 x86_64 xtensa
119 # For arm64, arc, xtensa we'll just keep KERNEL_ARCH
120 # For mips64, we'll just keep mips
121 # For i386 and x86_64, we need to convert
122 ifeq ($(KERNEL_ARCH),x86_64)
123 MKIMAGE_ARCH = x86
124 else ifeq ($(KERNEL_ARCH),i386)
125 MKIMAGE_ARCH = x86
126 else
127 MKIMAGE_ARCH = $(KERNEL_ARCH)
128 endif