2005-04-16 22:20:36 +00:00
|
|
|
#
|
|
|
|
# arch/arm/boot/Makefile
|
|
|
|
#
|
2006-03-05 22:14:10 +00:00
|
|
|
# This file is included by the global makefile so that you can add your own
|
|
|
|
# architecture-specific flags and dependencies.
|
|
|
|
#
|
2005-04-16 22:20:36 +00:00
|
|
|
# This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
# License. See the file "COPYING" in the main directory of this archive
|
|
|
|
# for more details.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1995-2002 Russell King
|
|
|
|
#
|
2016-07-19 10:23:37 +00:00
|
|
|
OBJCOPYFLAGS :=-O binary -R .comment -S
|
|
|
|
|
2010-09-09 21:39:41 +00:00
|
|
|
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
|
2022-07-27 07:26:45 +00:00
|
|
|
ifdef CONFIG_PHYS_OFFSET
|
|
|
|
add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
|
|
|
|
ZRELADDR := $(call add_hex, $(CONFIG_PHYS_OFFSET), $(TEXT_OFFSET))
|
|
|
|
endif
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2022-07-27 07:26:45 +00:00
|
|
|
PHYS_OFFSET := $(CONFIG_PHYS_OFFSET)
|
|
|
|
export ZRELADDR PARAMS_PHYS PHYS_OFFSET
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
targets := Image zImage xipImage bootpImage uImage
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_XIP_KERNEL),y)
|
|
|
|
|
kbuild: use $(src) instead of $(srctree)/$(src) for source directory
Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for
checked-in source files. It is merely a convention without any functional
difference. In fact, $(obj) and $(src) are exactly the same, as defined
in scripts/Makefile.build:
src := $(obj)
When the kernel is built in a separate output directory, $(src) does
not accurately reflect the source directory location. While Kbuild
resolves this discrepancy by specifying VPATH=$(srctree) to search for
source files, it does not cover all cases. For example, when adding a
header search path for local headers, -I$(srctree)/$(src) is typically
passed to the compiler.
This introduces inconsistency between upstream and downstream Makefiles
because $(src) is used instead of $(srctree)/$(src) for the latter.
To address this inconsistency, this commit changes the semantics of
$(src) so that it always points to the directory in the source tree.
Going forward, the variables used in Makefiles will have the following
meanings:
$(obj) - directory in the object tree
$(src) - directory in the source tree (changed by this commit)
$(objtree) - the top of the kernel object tree
$(srctree) - the top of the kernel source tree
Consequently, $(srctree)/$(src) in upstream Makefiles need to be replaced
with $(src).
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2024-04-27 14:55:02 +00:00
|
|
|
cmd_deflate_xip_data = $(CONFIG_SHELL) -c '$(src)/deflate_xip_data.sh $< $@'
|
2017-08-25 04:54:18 +00:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
|
|
|
|
quiet_cmd_mkxip = XIPZ $@
|
|
|
|
cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xip_data)
|
|
|
|
else
|
|
|
|
quiet_cmd_mkxip = $(quiet_cmd_objcopy)
|
|
|
|
cmd_mkxip = $(cmd_objcopy)
|
|
|
|
endif
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
$(obj)/xipImage: vmlinux FORCE
|
2017-08-25 04:54:18 +00:00
|
|
|
$(call if_changed,mkxip)
|
2016-05-30 02:01:23 +00:00
|
|
|
@$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)'
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
$(obj)/Image $(obj)/zImage: FORCE
|
|
|
|
@echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
|
|
|
|
@echo 'Only the xipImage target is available in this case'
|
|
|
|
@false
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
$(obj)/xipImage: FORCE
|
|
|
|
@echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
|
|
|
|
@false
|
|
|
|
|
|
|
|
$(obj)/Image: vmlinux FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
|
|
|
$(obj)/compressed/vmlinux: $(obj)/Image FORCE
|
|
|
|
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
|
|
|
|
|
|
|
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2012-03-16 21:03:55 +00:00
|
|
|
ifneq ($(LOADADDR),)
|
|
|
|
UIMAGE_LOADADDR=$(LOADADDR)
|
2008-03-06 15:22:33 +00:00
|
|
|
else
|
2012-03-16 21:03:55 +00:00
|
|
|
ifeq ($(CONFIG_ZBOOT_ROM),y)
|
|
|
|
UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
|
|
|
|
else
|
|
|
|
UIMAGE_LOADADDR=$(ZRELADDR)
|
|
|
|
endif
|
2008-03-06 15:22:33 +00:00
|
|
|
endif
|
|
|
|
|
2011-08-17 13:23:46 +00:00
|
|
|
check_for_multiple_loadaddr = \
|
2013-02-23 07:02:24 +00:00
|
|
|
if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
|
|
|
|
echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
|
2011-08-17 13:23:46 +00:00
|
|
|
echo 'This is incompatible with uImages'; \
|
|
|
|
echo 'Specify LOADADDR on the commandline to build an uImage'; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
$(obj)/uImage: $(obj)/zImage FORCE
|
2011-08-17 13:23:46 +00:00
|
|
|
@$(check_for_multiple_loadaddr)
|
2005-04-16 22:20:36 +00:00
|
|
|
$(call if_changed,uimage)
|
|
|
|
|
2022-07-27 07:26:45 +00:00
|
|
|
$(obj)/bootp/bootp: $(obj)/zImage FORCE
|
2005-04-16 22:20:36 +00:00
|
|
|
$(Q)$(MAKE) $(build)=$(obj)/bootp $@
|
|
|
|
|
|
|
|
$(obj)/bootpImage: $(obj)/bootp/bootp FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
2013-01-22 21:27:29 +00:00
|
|
|
subdir- := bootp compressed dts
|