2002-07-20 20:14:13 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2000-2006
|
2002-07-20 20:14:13 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
2013-07-08 07:37:19 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-07-20 20:14:13 +00:00
|
|
|
#
|
|
|
|
|
2010-01-21 09:03:22 +00:00
|
|
|
# Enable all the config-independent tools
|
|
|
|
ifneq ($(HOST_TOOLS_ALL),)
|
|
|
|
CONFIG_LCD_LOGO = y
|
2010-08-15 04:03:19 +00:00
|
|
|
CONFIG_CMD_LOADS = y
|
2010-01-21 09:03:22 +00:00
|
|
|
CONFIG_CMD_NET = y
|
2011-07-27 11:22:36 +00:00
|
|
|
CONFIG_XWAY_SWAP_BYTES = y
|
2010-01-21 09:03:22 +00:00
|
|
|
CONFIG_NETCONSOLE = y
|
|
|
|
CONFIG_SHA1_CHECK_UB_IMG = y
|
|
|
|
endif
|
|
|
|
|
2014-02-04 08:24:39 +00:00
|
|
|
subdir-$(HOST_TOOLS_ALL) += easylogo
|
|
|
|
subdir-$(HOST_TOOLS_ALL) += gdb
|
|
|
|
|
2011-06-19 08:27:39 +00:00
|
|
|
# Merge all the different vars for envcrc into one
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_DATAFLASH) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
|
|
|
|
ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
|
|
|
|
CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y)
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params
|
2014-05-19 12:23:40 +00:00
|
|
|
|
2014-02-04 08:24:10 +00:00
|
|
|
# TODO: CONFIG_CMD_LICENSE does not work
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_LICENSE) += bin2header
|
|
|
|
hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo
|
|
|
|
hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo
|
|
|
|
HOSTCFLAGS_bmp_logo.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc
|
|
|
|
envcrc-objs := envcrc.o lib/crc32.o common/env_embedded.o lib/sha1.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr
|
|
|
|
HOSTCFLAGS_gen_eth_addr.o := -pedantic
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_CMD_LOADS) += img2srec
|
|
|
|
HOSTCFLAGS_img2srec.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes
|
|
|
|
HOSTCFLAGS_xway-swap-bytes.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-y += mkenvimage
|
|
|
|
mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-y += dumpimage mkimage
|
|
|
|
hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 05:04:32 +00:00
|
|
|
FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
|
2009-03-13 23:54:34 +00:00
|
|
|
# Flattened device tree objects
|
2014-06-06 05:04:32 +00:00
|
|
|
LIBFDT_OBJS := $(addprefix lib/libfdt/, \
|
|
|
|
fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o)
|
|
|
|
RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
|
|
|
|
rsa-sign.o rsa-verify.o rsa-checksum.o)
|
2014-02-04 08:24:10 +00:00
|
|
|
|
|
|
|
# common objs for dumpimage and mkimage
|
|
|
|
dumpimage-mkimage-objs := aisimage.o \
|
2014-05-19 12:23:39 +00:00
|
|
|
atmelimage.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
$(FIT_SIG_OBJS-y) \
|
2014-06-12 13:24:51 +00:00
|
|
|
common/bootm.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/crc32.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
default_image.o \
|
2014-06-22 04:33:29 +00:00
|
|
|
lib/fdtdec_common.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/fdtdec.o \
|
2014-03-03 11:19:29 +00:00
|
|
|
fit_common.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
fit_image.o \
|
2014-04-04 17:16:48 +00:00
|
|
|
gpimage.o \
|
|
|
|
gpimage-common.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
common/image-fit.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
image-host.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
common/image.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
imagetool.o \
|
|
|
|
imximage.o \
|
|
|
|
kwbimage.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/md5.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
mxsimage.o \
|
|
|
|
omapimage.o \
|
|
|
|
os_support.o \
|
|
|
|
pblimage.o \
|
2014-05-14 02:45:00 +00:00
|
|
|
pbl_crc32.o \
|
2014-03-06 02:40:50 +00:00
|
|
|
socfpgaimage.o \
|
2014-06-06 05:04:32 +00:00
|
|
|
lib/sha1.o \
|
|
|
|
lib/sha256.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
ublimage.o \
|
|
|
|
$(LIBFDT_OBJS) \
|
|
|
|
$(RSA_OBJS-y)
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o
|
|
|
|
mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o
|
|
|
|
fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o
|
|
|
|
fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
|
|
|
# TODO(sjg@chromium.org): Is this correct on Mac OS?
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_MX23)$(CONFIG_MX28),)
|
|
|
|
# Add CONFIG_MXS into host CFLAGS, so we can check whether or not register
|
|
|
|
# the mxsimage support within tools/mxsimage.c .
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
HOSTCFLAGS_mxsimage.o += -DCONFIG_MXS
|
2014-02-04 08:24:10 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_FIT_SIGNATURE
|
|
|
|
# This affects include/image.h, but including the board config file
|
|
|
|
# is tricky, so manually define this options here.
|
|
|
|
HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE
|
|
|
|
endif
|
|
|
|
|
2014-06-05 07:41:49 +00:00
|
|
|
# MXSImage needs LibSSL
|
|
|
|
ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),)
|
2014-06-06 11:46:44 +00:00
|
|
|
HOSTLOADLIBES_mkimage += -lssl -lcrypto
|
2014-06-05 07:41:49 +00:00
|
|
|
endif
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)
|
|
|
|
HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
|
|
|
|
HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage)
|
2014-06-05 07:41:49 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl
|
|
|
|
hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
|
|
|
|
HOSTCFLAGS_mkexynosspl.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_MX23) += mxsboot
|
|
|
|
hostprogs-$(CONFIG_MX28) += mxsboot
|
|
|
|
HOSTCFLAGS_mxsboot.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_SUNXI) += mksunxiboot
|
2014-05-05 10:52:30 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_NETCONSOLE) += ncb
|
|
|
|
hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
ubsha1-objs := os_support.o ubsha1.o lib/sha1.o
|
2014-02-04 08:24:10 +00:00
|
|
|
|
|
|
|
HOSTCFLAGS_ubsha1.o := -pedantic
|
|
|
|
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-$(CONFIG_KIRKWOOD) += kwboot
|
2014-10-22 10:13:22 +00:00
|
|
|
hostprogs-$(CONFIG_ARMADA_XP) += kwboot
|
2014-06-06 11:46:44 +00:00
|
|
|
hostprogs-y += proftool
|
|
|
|
hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2014-02-04 08:24:10 +00:00
|
|
|
# We build some files with extra pedantic flags to try to minimize things
|
|
|
|
# that won't build on some weird host compiler -- though there are lots of
|
|
|
|
# exceptions for files that aren't complaint.
|
|
|
|
HOSTCFLAGS_crc32.o := -pedantic
|
|
|
|
HOSTCFLAGS_md5.o := -pedantic
|
|
|
|
HOSTCFLAGS_sha1.o := -pedantic
|
2014-03-03 11:19:25 +00:00
|
|
|
HOSTCFLAGS_sha256.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
|
|
|
# Don't build by default
|
2014-06-06 11:46:44 +00:00
|
|
|
#hostprogs-$(CONFIG_PPC) += mpc86x_clk
|
|
|
|
#HOSTCFLAGS_mpc86x_clk.o := -pedantic
|
2014-02-04 08:24:10 +00:00
|
|
|
|
2014-06-06 05:04:32 +00:00
|
|
|
quiet_cmd_wrap = WRAP $@
|
2014-10-30 02:06:11 +00:00
|
|
|
cmd_wrap = echo "\#include <../$(patsubst $(obj)/%,%,$@)>" >$@
|
2014-06-06 05:04:32 +00:00
|
|
|
|
|
|
|
$(obj)/lib/%.c $(obj)/common/%.c:
|
|
|
|
$(call cmd,wrap)
|
|
|
|
|
|
|
|
clean-dirs := lib common
|
|
|
|
|
2014-02-04 08:24:10 +00:00
|
|
|
always := $(hostprogs-y)
|
2013-06-13 22:10:02 +00:00
|
|
|
|
2009-03-13 23:54:35 +00:00
|
|
|
# Generated LCD/video logo
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_H = $(objtree)/include/bmp_logo.h
|
|
|
|
LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h
|
2009-03-13 23:54:35 +00:00
|
|
|
LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_H)
|
2011-10-20 23:04:20 +00:00
|
|
|
LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_DATA_H)
|
2009-03-13 23:54:35 +00:00
|
|
|
LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H)
|
2011-10-20 23:04:20 +00:00
|
|
|
LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_DATA_H)
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2013-05-27 12:18:43 +00:00
|
|
|
# Generic logo
|
2009-03-13 23:54:34 +00:00
|
|
|
ifeq ($(LOGO_BMP),)
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_BMP= $(srctree)/$(src)/logos/denx.bmp
|
2013-05-27 12:18:43 +00:00
|
|
|
|
|
|
|
# Use board logo and fallback to vendor
|
2014-03-03 09:40:56 +00:00
|
|
|
ifneq ($(wildcard $(srctree)/$(src)/logos/$(BOARD).bmp),)
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_BMP= $(srctree)/$(src)/logos/$(BOARD).bmp
|
2013-05-27 12:18:43 +00:00
|
|
|
else
|
2014-03-03 09:40:56 +00:00
|
|
|
ifneq ($(wildcard $(srctree)/$(src)/logos/$(VENDOR).bmp),)
|
2014-02-04 08:24:24 +00:00
|
|
|
LOGO_BMP= $(srctree)/$(src)/logos/$(VENDOR).bmp
|
2009-03-13 23:54:34 +00:00
|
|
|
endif
|
2011-07-16 10:26:50 +00:00
|
|
|
endif
|
2009-03-13 23:54:34 +00:00
|
|
|
|
2013-05-27 12:18:43 +00:00
|
|
|
endif # !LOGO_BMP
|
|
|
|
|
2002-07-20 20:14:13 +00:00
|
|
|
#
|
|
|
|
# Use native tools and options
|
2009-03-13 23:54:51 +00:00
|
|
|
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
|
2013-07-30 22:26:11 +00:00
|
|
|
# Define _GNU_SOURCE to obtain the getline prototype from stdio.h
|
2002-07-20 20:14:13 +00:00
|
|
|
#
|
2014-03-11 02:05:20 +00:00
|
|
|
HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \
|
kconfig: switch to Kconfig
This commit enables Kconfig.
Going forward, we use Kconfig for the board configuration.
mkconfig will never be used. Nor will include/config.mk be generated.
Kconfig must be adjusted for U-Boot because our situation is
a little more complicated than Linux Kernel.
We have to generate multiple boot images (Normal, SPL, TPL)
from one source tree.
Each image needs its own configuration input.
Usage:
Run "make <board>_defconfig" to do the board configuration.
It will create the .config file and additionally spl/.config, tpl/.config
if SPL, TPL is enabled, respectively.
You can use "make config", "make menuconfig" etc. to create
a new .config or modify the existing one.
Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
and do likewise for tpl/.config file.
The generic syntax of configuration targets for SPL, TPL is:
<target_image>/<config_command>
Here, <target_image> is either 'spl' or 'tpl'
<config_command> is 'config', 'menuconfig', 'xconfig', etc.
When the configuration is done, run "make".
(Or "make <board>_defconfig all" will do the configuration and build
in one time.)
For futher information of how Kconfig works in U-Boot,
please read the comment block of scripts/multiconfig.py.
By the way, there is another item worth remarking here:
coexistence of Kconfig and board herder files.
Prior to Kconfig, we used C headers to define a set of configs.
We expect a very long term to migrate from C headers to Kconfig.
Two different infractructure must coexist in the interim.
In our former configuration scheme, include/autoconf.mk was generated
for use in makefiles.
It is still generated under include/, spl/include/, tpl/include/ directory
for the Normal, SPL, TPL image, respectively.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-07-30 05:08:17 +00:00
|
|
|
$(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
|
2014-03-11 02:05:20 +00:00
|
|
|
-I$(srctree)/lib/libfdt \
|
|
|
|
-I$(srctree)/tools \
|
2010-10-07 19:51:12 +00:00
|
|
|
-DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
|
|
|
|
-DUSE_HOSTCC \
|
2013-07-30 22:26:11 +00:00
|
|
|
-D__KERNEL_STRICT_NAMES \
|
|
|
|
-D_GNU_SOURCE
|
2008-02-29 15:00:24 +00:00
|
|
|
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
__build: $(LOGO-y)
|
2002-07-20 20:14:13 +00:00
|
|
|
|
2014-02-04 08:24:24 +00:00
|
|
|
$(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP)
|
|
|
|
$(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@
|
2011-10-20 23:04:20 +00:00
|
|
|
|
2014-02-04 08:24:24 +00:00
|
|
|
$(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP)
|
|
|
|
$(obj)/bmp_logo --gen-data $(LOGO_BMP) > $@
|
2014-02-04 08:24:39 +00:00
|
|
|
|
|
|
|
# Let clean descend into subdirs
|
|
|
|
subdir- += env
|
2014-03-03 02:06:19 +00:00
|
|
|
|
|
|
|
ifneq ($(CROSS_BUILD_TOOLS),)
|
|
|
|
HOSTCC = $(CC)
|
|
|
|
|
|
|
|
quiet_cmd_crosstools_strip = STRIP $^
|
|
|
|
cmd_crosstools_strip = $(STRIP) $^; touch $@
|
|
|
|
$(obj)/.strip: $(call objectify,$(filter $(always),$(hostprogs-y)))
|
|
|
|
$(call cmd,crosstools_strip)
|
|
|
|
|
|
|
|
always += .strip
|
|
|
|
endif
|
|
|
|
clean-files += .strip
|