0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 OBJCOPYFLAGS :=-O binary -R .comment -S
0015
0016 ifneq ($(MACHINE),)
0017 include $(MACHINE)/Makefile.boot
0018 endif
0019
0020
0021
0022
0023
0024 ZRELADDR := $(zreladdr-y)
0025 PARAMS_PHYS := $(params_phys-y)
0026 INITRD_PHYS := $(initrd_phys-y)
0027
0028 export ZRELADDR INITRD_PHYS PARAMS_PHYS
0029
0030 targets := Image zImage xipImage bootpImage uImage
0031
0032 ifeq ($(CONFIG_XIP_KERNEL),y)
0033
0034 cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
0035 '$(srctree)/$(src)/deflate_xip_data.sh $< $@'
0036
0037 ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
0038 quiet_cmd_mkxip = XIPZ $@
0039 cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xip_data)
0040 else
0041 quiet_cmd_mkxip = $(quiet_cmd_objcopy)
0042 cmd_mkxip = $(cmd_objcopy)
0043 endif
0044
0045 $(obj)/xipImage: vmlinux FORCE
0046 $(call if_changed,mkxip)
0047 @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)'
0048
0049 $(obj)/Image $(obj)/zImage: FORCE
0050 @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
0051 @echo 'Only the xipImage target is available in this case'
0052 @false
0053
0054 else
0055
0056 $(obj)/xipImage: FORCE
0057 @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
0058 @false
0059
0060 $(obj)/Image: vmlinux FORCE
0061 $(call if_changed,objcopy)
0062
0063 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
0064 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
0065
0066 $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
0067 $(call if_changed,objcopy)
0068
0069 endif
0070
0071 ifneq ($(LOADADDR),)
0072 UIMAGE_LOADADDR=$(LOADADDR)
0073 else
0074 ifeq ($(CONFIG_ZBOOT_ROM),y)
0075 UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
0076 else
0077 UIMAGE_LOADADDR=$(ZRELADDR)
0078 endif
0079 endif
0080
0081 check_for_multiple_loadaddr = \
0082 if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
0083 echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
0084 echo 'This is incompatible with uImages'; \
0085 echo 'Specify LOADADDR on the commandline to build an uImage'; \
0086 false; \
0087 fi
0088
0089 $(obj)/uImage: $(obj)/zImage FORCE
0090 @$(check_for_multiple_loadaddr)
0091 $(call if_changed,uimage)
0092
0093 $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
0094 $(Q)$(MAKE) $(build)=$(obj)/bootp $@
0095
0096 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
0097 $(call if_changed,objcopy)
0098
0099 PHONY += initrd
0100 initrd:
0101 @test "$(INITRD_PHYS)" != "" || \
0102 (echo This machine does not support INITRD; exit -1)
0103 @test "$(INITRD)" != "" || \
0104 (echo You must specify INITRD; exit -1)
0105
0106 subdir- := bootp compressed dts