python3: make readline, gzip, bzip2 and xz really optional
[buildroot-gz.git] / boot / mxs-bootlets / mxs-bootlets.mk
blob17af6dc1588107a62238582131aa144e83ee8cfd
1 ################################################################################
3 # mxs-bootlets
5 ################################################################################
7 ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL),y)
8 MXS_BOOTLETS_TARBALL = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL))
9 MXS_BOOTLETS_SITE = $(patsubst %/,%,$(dir $(MXS_BOOTLETS_TARBALL)))
10 MXS_BOOTLETS_SOURCE = $(notdir $(MXS_BOOTLETS_TARBALL))
11 BR_NO_CHECK_HASH_FOR += $(MXS_BOOTLETS_SOURCE)
12 else ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT),y)
13 MXS_BOOTLETS_SITE = $(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_URL)
14 MXS_BOOTLETS_SITE_METHOD = git
15 MXS_BOOTLETS_VERSION = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION))
16 else
17 MXS_BOOTLETS_VERSION = 10.12.01
18 MXS_BOOTLETS_SITE = http://download.ossystems.com.br/bsp/freescale/source
19 MXS_BOOTLETS_SOURCE = imx-bootlets-src-$(MXS_BOOTLETS_VERSION).tar.gz
20 endif
22 ifeq ($(BR2_TARGET_MXS_BOOTLETS_STMP37xx),y)
23 MXS_BOOTLETS_BOARD = stmp37xx_dev
24 else ifeq ($(BR2_TARGET_MXS_BOOTLETS_STMP378x),y)
25 MXS_BOOTLETS_BOARD = stmp378x_dev
26 else ifeq ($(BR2_TARGET_MXS_BOOTLETS_IMX28EVK),y)
27 MXS_BOOTLETS_BOARD = iMX28_EVK
28 else ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD),y)
29 MXS_BOOTLETS_BOARD = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME))
30 endif
32 ifeq ($(BR2_TARGET_MXS_BOOTLETS_HAS_IVT),y)
33 MXS_BOOTLETS_IVT_SUFFIX = _ivt
34 MXS_BOOTLETS_ELFTOSB_OPTIONS += -f imx28
35 endif
37 MXS_BOOTLETS_DEPENDENCIES = host-elftosb
38 MXS_BOOTLETS_LICENSE = GPLv2+
40 ifeq ($(BR2_TARGET_MXS_BOOTLETS_BAREBOX),y)
41 MXS_BOOTLETS_DEPENDENCIES += barebox
42 MXS_BOOTLETS_BOOTDESC = barebox$(MXS_BOOTLETS_IVT_SUFFIX).bd
43 MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_barebox$(MXS_BOOTLETS_IVT_SUFFIX).sb
45 else ifeq ($(BR2_TARGET_MXS_BOOTLETS_LINUX),y)
46 MXS_BOOTLETS_DEPENDENCIES += linux
47 MXS_BOOTLETS_BOOTDESC = linux$(MXS_BOOTLETS_IVT_SUFFIX).bd
48 MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_linux$(MXS_BOOTLETS_IVT_SUFFIX).sb
50 else ifeq ($(BR2_TARGET_MXS_BOOTLETS_UBOOT),y)
51 MXS_BOOTLETS_DEPENDENCIES += uboot
52 MXS_BOOTLETS_BOOTDESC = uboot$(MXS_BOOTLETS_IVT_SUFFIX).bd
53 MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_uboot$(MXS_BOOTLETS_IVT_SUFFIX).sb
54 endif
56 ifeq ($(BR2_TARGET_MXS_BOOTLETS_BAREBOX),y)
57 define MXS_BOOTLETS_SED_BAREBOX
58 sed -i 's,[^ *]barebox.*;,\tbarebox="$(BAREBOX_DIR)/barebox";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
59 endef
60 endif
62 ifeq ($(BR2_TARGET_MXS_BOOTLETS_LINUX),y)
63 define MXS_BOOTLETS_BUILD_LINUX_PREP
64 BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
65 $(MAKE1) -C $(@D) linux_prep
66 endef
67 define MXS_BOOTLETS_SED_LINUX
68 sed -i 's,[^ *]linux_prep.*;,\tlinux_prep="$(@D)/linux_prep/output-target/linux_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
69 sed -i 's,[^ *]zImage.*;,\tzImage="$(LINUX_DIR)/arch/arm/boot/zImage";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
70 endef
71 endif
73 ifeq ($(BR2_TARGET_MXS_BOOTLETS_UBOOT),y)
74 define MXS_BOOTLETS_SED_UBOOT
75 sed -i 's,[^ *]u_boot.*;,\tu_boot="$(UBOOT_DIR)/u-boot";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
76 endef
77 endif
79 define MXS_BOOTLETS_INSTALL_BAREBOX_BOOTDESC
80 cp boot/mxs-bootlets/barebox_ivt.bd $(@D)/
81 endef
83 MXS_BOOTLETS_POST_EXTRACT_HOOKS += MXS_BOOTLETS_INSTALL_BAREBOX_BOOTDESC
85 define MXS_BOOTLETS_BUILD_CMDS
86 BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
87 $(MAKE1) -C $(@D) power_prep
88 BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
89 $(MAKE1) -C $(@D) boot_prep
90 $(MXS_BOOTLETS_BUILD_LINUX_PREP)
91 sed -i 's,[^ *]power_prep.*;,\tpower_prep="$(@D)/power_prep/power_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
92 sed -i 's,[^ *]sdram_prep.*;,\tsdram_prep="$(@D)/boot_prep/boot_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
93 $(MXS_BOOTLETS_SED_BAREBOX)
94 $(MXS_BOOTLETS_SED_LINUX)
95 $(MXS_BOOTLETS_SED_UBOOT)
96 $(HOST_DIR)/usr/bin/elftosb $(MXS_BOOTLETS_ELFTOSB_OPTIONS) \
97 -z -c $(@D)/$(MXS_BOOTLETS_BOOTDESC) \
98 -o $(@D)/$(MXS_BOOTLETS_BOOTSTREAM)
99 endef
101 define MXS_BOOTLETS_INSTALL_TARGET_CMDS
102 cp $(@D)/$(MXS_BOOTLETS_BOOTSTREAM) $(BINARIES_DIR)/
103 endef
105 $(eval $(generic-package))