]>
Commit | Line | Data |
---|---|---|
efee1709 | 1 | # |
f9328639 | 2 | # (C) Copyright 2000-2006 |
efee1709 WD |
3 | # Wolfgang Denk, DENX Software Engineering, [email protected]. |
4 | # | |
1a459660 | 5 | # SPDX-License-Identifier: GPL-2.0+ |
efee1709 WD |
6 | # |
7 | ||
c7c0d542 MF |
8 | # Enable all the config-independent tools |
9 | ifneq ($(HOST_TOOLS_ALL),) | |
10 | CONFIG_LCD_LOGO = y | |
570d7d50 | 11 | CONFIG_CMD_LOADS = y |
c7c0d542 | 12 | CONFIG_CMD_NET = y |
60b74bde | 13 | CONFIG_XWAY_SWAP_BYTES = y |
c7c0d542 MF |
14 | CONFIG_NETCONSOLE = y |
15 | CONFIG_SHA1_CHECK_UB_IMG = y | |
16 | endif | |
17 | ||
2887c473 MY |
18 | subdir-$(HOST_TOOLS_ALL) += easylogo |
19 | subdir-$(HOST_TOOLS_ALL) += gdb | |
20 | ||
2ad6e27d MF |
21 | # Merge all the different vars for envcrc into one |
22 | ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y | |
23 | ENVCRC-$(CONFIG_ENV_IS_IN_DATAFLASH) = y | |
24 | ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y | |
25 | ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y | |
26 | ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y | |
27 | ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y | |
28 | ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y | |
29 | ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y | |
30 | CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y) | |
31 | ||
96b09a97 | 32 | hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params |
5c390a5b | 33 | |
96b09a97 MY |
34 | hostprogs-$(CONFIG_CMD_LICENSE) += bin2header |
35 | hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo | |
36 | hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo | |
37 | HOSTCFLAGS_bmp_logo.o := -pedantic | |
940db16d | 38 | |
96b09a97 MY |
39 | hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc |
40 | envcrc-objs := envcrc.o lib/crc32.o common/env_embedded.o lib/sha1.o | |
940db16d | 41 | |
96b09a97 MY |
42 | hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr |
43 | HOSTCFLAGS_gen_eth_addr.o := -pedantic | |
ee3584a5 | 44 | |
96b09a97 MY |
45 | hostprogs-$(CONFIG_CMD_LOADS) += img2srec |
46 | HOSTCFLAGS_img2srec.o := -pedantic | |
940db16d | 47 | |
96b09a97 MY |
48 | hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes |
49 | HOSTCFLAGS_xway-swap-bytes.o := -pedantic | |
940db16d | 50 | |
96b09a97 MY |
51 | hostprogs-y += mkenvimage |
52 | mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o | |
940db16d | 53 | |
96b09a97 MY |
54 | hostprogs-y += dumpimage mkimage |
55 | hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign | |
940db16d | 56 | |
ad80c4a3 | 57 | FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o |
ee3584a5 | 58 | # Flattened device tree objects |
ad80c4a3 | 59 | LIBFDT_OBJS := $(addprefix lib/libfdt/, \ |
1043d0a0 | 60 | fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o \ |
e2070a89 | 61 | fdt_region.o fdt_sw.o) |
ad80c4a3 | 62 | RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \ |
fc2f4246 RG |
63 | rsa-sign.o rsa-verify.o rsa-checksum.o \ |
64 | rsa-mod-exp.o) | |
940db16d | 65 | |
9b03701a | 66 | ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o |
a131c1f4 | 67 | |
940db16d MY |
68 | # common objs for dumpimage and mkimage |
69 | dumpimage-mkimage-objs := aisimage.o \ | |
7b1a4117 | 70 | atmelimage.o \ |
940db16d | 71 | $(FIT_SIG_OBJS-y) \ |
ea51a628 | 72 | common/bootm.o \ |
ad80c4a3 | 73 | lib/crc32.o \ |
940db16d | 74 | default_image.o \ |
b047d671 | 75 | lib/fdtdec_common.o \ |
ad80c4a3 | 76 | lib/fdtdec.o \ |
6bf4ca07 | 77 | fit_common.o \ |
940db16d | 78 | fit_image.o \ |
bf411ea9 KM |
79 | gpimage.o \ |
80 | gpimage-common.o \ | |
ad80c4a3 | 81 | common/image-fit.o \ |
940db16d | 82 | image-host.o \ |
ad80c4a3 | 83 | common/image.o \ |
940db16d MY |
84 | imagetool.o \ |
85 | imximage.o \ | |
86 | kwbimage.o \ | |
ad80c4a3 | 87 | lib/md5.o \ |
39f520bb | 88 | lpc32xximage.o \ |
940db16d MY |
89 | mxsimage.o \ |
90 | omapimage.o \ | |
91 | os_support.o \ | |
92 | pblimage.o \ | |
abbc67ee | 93 | pbl_crc32.o \ |
a131c1f4 | 94 | $(ROCKCHIP_OBS) \ |
832472a9 | 95 | socfpgaimage.o \ |
ad80c4a3 MY |
96 | lib/sha1.o \ |
97 | lib/sha256.o \ | |
2dd90027 | 98 | common/hash.o \ |
940db16d | 99 | ublimage.o \ |
66eef1e7 | 100 | zynqimage.o \ |
d9b58b30 | 101 | zynqmpimage.o \ |
940db16d MY |
102 | $(LIBFDT_OBJS) \ |
103 | $(RSA_OBJS-y) | |
104 | ||
96b09a97 MY |
105 | dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o |
106 | mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o | |
107 | fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o | |
108 | fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o | |
940db16d MY |
109 | |
110 | # TODO([email protected]): Is this correct on Mac OS? | |
111 | ||
940db16d | 112 | ifneq ($(CONFIG_MX23)$(CONFIG_MX28),) |
940db16d MY |
113 | # Add CONFIG_MXS into host CFLAGS, so we can check whether or not register |
114 | # the mxsimage support within tools/mxsimage.c . | |
6825a95b | 115 | HOSTCFLAGS_mxsimage.o += -DCONFIG_MXS |
940db16d MY |
116 | endif |
117 | ||
118 | ifdef CONFIG_FIT_SIGNATURE | |
940db16d MY |
119 | # This affects include/image.h, but including the board config file |
120 | # is tricky, so manually define this options here. | |
121 | HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE | |
122 | endif | |
123 | ||
7ddf8cfb SR |
124 | ifdef CONFIG_SYS_U_BOOT_OFFS |
125 | HOSTCFLAGS_kwbimage.o += -DCONFIG_SYS_U_BOOT_OFFS=$(CONFIG_SYS_U_BOOT_OFFS) | |
e35c6c79 TR |
126 | endif |
127 | ||
97cb4e54 MY |
128 | # MXSImage needs LibSSL |
129 | ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),) | |
4839836a TP |
130 | HOSTLOADLIBES_mkimage += \ |
131 | $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto") | |
c6e3e821 AB |
132 | |
133 | # OS X deprecate openssl in favour of CommonCrypto, supress deprecation | |
134 | # warnings on those systems | |
135 | ifeq ($(HOSTOS),darwin) | |
136 | HOSTCFLAGS_mxsimage.o += -Wno-deprecated-declarations | |
137 | HOSTCFLAGS_image-sig.o += -Wno-deprecated-declarations | |
138 | HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations | |
139 | endif | |
97cb4e54 MY |
140 | endif |
141 | ||
96b09a97 MY |
142 | HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage) |
143 | HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage) | |
144 | HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage) | |
97cb4e54 | 145 | |
96b09a97 MY |
146 | hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl |
147 | hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl | |
148 | HOSTCFLAGS_mkexynosspl.o := -pedantic | |
940db16d | 149 | |
31eca697 | 150 | ifdtool-objs := $(LIBFDT_OBJS) ifdtool.o |
cd392fe8 SG |
151 | hostprogs-$(CONFIG_X86) += ifdtool |
152 | ||
96b09a97 MY |
153 | hostprogs-$(CONFIG_MX23) += mxsboot |
154 | hostprogs-$(CONFIG_MX28) += mxsboot | |
155 | HOSTCFLAGS_mxsboot.o := -pedantic | |
940db16d | 156 | |
96b09a97 | 157 | hostprogs-$(CONFIG_SUNXI) += mksunxiboot |
50827a59 | 158 | |
96b09a97 MY |
159 | hostprogs-$(CONFIG_NETCONSOLE) += ncb |
160 | hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1 | |
940db16d | 161 | |
96b09a97 | 162 | ubsha1-objs := os_support.o ubsha1.o lib/sha1.o |
940db16d MY |
163 | |
164 | HOSTCFLAGS_ubsha1.o := -pedantic | |
165 | ||
96b09a97 | 166 | hostprogs-$(CONFIG_KIRKWOOD) += kwboot |
81e33f4b | 167 | hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot |
96b09a97 MY |
168 | hostprogs-y += proftool |
169 | hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela | |
ee3584a5 | 170 | |
1043d0a0 SG |
171 | hostprogs-y += fdtgrep |
172 | fdtgrep-objs += $(LIBFDT_OBJS) fdtgrep.o | |
173 | ||
940db16d MY |
174 | # We build some files with extra pedantic flags to try to minimize things |
175 | # that won't build on some weird host compiler -- though there are lots of | |
176 | # exceptions for files that aren't complaint. | |
177 | HOSTCFLAGS_crc32.o := -pedantic | |
178 | HOSTCFLAGS_md5.o := -pedantic | |
179 | HOSTCFLAGS_sha1.o := -pedantic | |
2842c1c2 | 180 | HOSTCFLAGS_sha256.o := -pedantic |
940db16d | 181 | |
ad80c4a3 | 182 | quiet_cmd_wrap = WRAP $@ |
ffe29ebc | 183 | cmd_wrap = echo "\#include <../$(patsubst $(obj)/%,%,$@)>" >$@ |
ad80c4a3 MY |
184 | |
185 | $(obj)/lib/%.c $(obj)/common/%.c: | |
186 | $(call cmd,wrap) | |
187 | ||
188 | clean-dirs := lib common | |
189 | ||
940db16d | 190 | always := $(hostprogs-y) |
19c402af | 191 | |
335ffe7e | 192 | # Generated LCD/video logo |
9e414032 MY |
193 | LOGO_H = $(objtree)/include/bmp_logo.h |
194 | LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h | |
335ffe7e | 195 | LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_H) |
c270730f | 196 | LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_DATA_H) |
335ffe7e | 197 | LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H) |
c270730f | 198 | LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_DATA_H) |
ee3584a5 | 199 | |
96903dae | 200 | # Generic logo |
ee3584a5 | 201 | ifeq ($(LOGO_BMP),) |
9e414032 | 202 | LOGO_BMP= $(srctree)/$(src)/logos/denx.bmp |
96903dae OS |
203 | |
204 | # Use board logo and fallback to vendor | |
603f51cb | 205 | ifneq ($(wildcard $(srctree)/$(src)/logos/$(BOARD).bmp),) |
9e414032 | 206 | LOGO_BMP= $(srctree)/$(src)/logos/$(BOARD).bmp |
96903dae | 207 | else |
603f51cb | 208 | ifneq ($(wildcard $(srctree)/$(src)/logos/$(VENDOR).bmp),) |
9e414032 | 209 | LOGO_BMP= $(srctree)/$(src)/logos/$(VENDOR).bmp |
ee3584a5 | 210 | endif |
348de314 | 211 | endif |
ee3584a5 | 212 | |
96903dae OS |
213 | endif # !LOGO_BMP |
214 | ||
8a7367ac TR |
215 | # Generated gziped GPL-2.0 license text |
216 | LICENSE_H = $(objtree)/include/license.h | |
217 | LICENSE-$(CONFIG_CMD_LICENSE) += $(LICENSE_H) | |
218 | ||
efee1709 WD |
219 | # |
220 | # Use native tools and options | |
2f8d396b | 221 | # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps |
2db1c3fc | 222 | # Define _GNU_SOURCE to obtain the getline prototype from stdio.h |
efee1709 | 223 | # |
01286329 | 224 | HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \ |
51148790 | 225 | $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ |
01286329 MY |
226 | -I$(srctree)/lib/libfdt \ |
227 | -I$(srctree)/tools \ | |
14d0a02a WD |
228 | -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \ |
229 | -DUSE_HOSTCC \ | |
2db1c3fc YS |
230 | -D__KERNEL_STRICT_NAMES \ |
231 | -D_GNU_SOURCE | |
8cf30809 | 232 | |
8a7367ac | 233 | __build: $(LOGO-y) $(LICENSE-y) |
efee1709 | 234 | |
9e414032 MY |
235 | $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP) |
236 | $(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@ | |
c270730f | 237 | |
9e414032 MY |
238 | $(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP) |
239 | $(obj)/bmp_logo --gen-data $(LOGO_BMP) > $@ | |
2887c473 | 240 | |
8a7367ac TR |
241 | $(LICENSE_H): $(obj)/bin2header $(srctree)/Licenses/gpl-2.0.txt |
242 | cat $(srctree)/Licenses/gpl-2.0.txt | gzip -9 -c | \ | |
243 | $(obj)/bin2header license_gzip > $(LICENSE_H) | |
244 | ||
2887c473 MY |
245 | # Let clean descend into subdirs |
246 | subdir- += env | |
db5b339c MY |
247 | |
248 | ifneq ($(CROSS_BUILD_TOOLS),) | |
249 | HOSTCC = $(CC) | |
250 | ||
251 | quiet_cmd_crosstools_strip = STRIP $^ | |
252 | cmd_crosstools_strip = $(STRIP) $^; touch $@ | |
253 | $(obj)/.strip: $(call objectify,$(filter $(always),$(hostprogs-y))) | |
254 | $(call cmd,crosstools_strip) | |
255 | ||
256 | always += .strip | |
257 | endif | |
258 | clean-files += .strip |