>> 1 # Makefile for the Sparc boot stuff. 1 # 2 # 2 # arch/arm/boot/Makefile !! 3 # Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 # !! 4 # Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) 4 # This file is included by the global makefile << 5 # architecture-specific flags and dependencies << 6 # << 7 # This file is subject to the terms and condit << 8 # License. See the file "COPYING" in the main << 9 # for more details. << 10 # << 11 # Copyright (C) 1995-2002 Russell King << 12 # << 13 OBJCOPYFLAGS :=-O binary -R .comment -S << 14 << 15 # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEX << 16 ifdef CONFIG_PHYS_OFFSET << 17 add_hex = $(shell printf 0x%x $$(( $(1) + $(2) << 18 ZRELADDR := $(call add_hex, $(CONFIG_PHYS_O << 19 endif << 20 << 21 PHYS_OFFSET := $(CONFIG_PHYS_OFFSET) << 22 export ZRELADDR PARAMS_PHYS PHYS_OFFSET << 23 5 24 targets := Image zImage xipImage bootpImage uI !! 6 ROOT_IMG := /usr/src/root.img >> 7 ELFTOAOUT := elftoaout 25 8 26 ifeq ($(CONFIG_XIP_KERNEL),y) !! 9 hostprogs-y := piggyback_32 piggyback_64 btfixupprep >> 10 targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout >> 11 clean-files := System.map >> 12 >> 13 quiet_cmd_elftoaout = ELFTOAOUT $@ >> 14 cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@ >> 15 >> 16 ifeq ($(CONFIG_SPARC32),y) >> 17 quiet_cmd_piggy = PIGGY $@ >> 18 cmd_piggy = $(obj)/piggyback_32 $@ System.map $(ROOT_IMG) >> 19 quiet_cmd_btfix = BTFIX $@ >> 20 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ >> 21 quiet_cmd_sysmap = SYSMAP $(obj)/System.map >> 22 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap >> 23 quiet_cmd_image = LD $@ >> 24 cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@ >> 25 quiet_cmd_strip = STRIP $@ >> 26 cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $(obj)/image -o $@ >> 27 >> 28 >> 29 define rule_image >> 30 $(if $($(quiet)cmd_image), \ >> 31 echo ' $($(quiet)cmd_image)' &&) \ >> 32 $(cmd_image); \ >> 33 $(if $($(quiet)cmd_sysmap), \ >> 34 echo ' $($(quiet)cmd_sysmap)' &&) \ >> 35 $(cmd_sysmap) $@ $(obj)/System.map; \ >> 36 if [ $$? -ne 0 ]; then \ >> 37 rm -f $@; \ >> 38 /bin/false; \ >> 39 fi; \ >> 40 echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd >> 41 endef >> 42 >> 43 BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT)) >> 44 BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN)) >> 45 LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ >> 46 --start-group $(BTLIBS) --end-group \ >> 47 $(kallsyms.o) $(obj)/btfix.o >> 48 >> 49 # Link the final image including btfixup'ed symbols. >> 50 # This is a replacement for the link done in the top-level Makefile. >> 51 # Note: No dependency on the prerequisite files since that would require >> 52 # make to try check if they are updated - and due to changes >> 53 # in gcc options (path for example) this would result in >> 54 # these files being recompiled for each build. >> 55 $(obj)/image: $(obj)/btfix.o FORCE >> 56 $(call if_changed_rule,image) >> 57 >> 58 $(obj)/zImage: $(obj)/image >> 59 $(call if_changed,strip) >> 60 >> 61 $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_32 System.map $(ROOT_IMG) FORCE >> 62 $(call if_changed,elftoaout) >> 63 $(call if_changed,piggy) 27 64 28 cmd_deflate_xip_data = $(CONFIG_SHELL) -c '$(s !! 65 $(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE >> 66 $(call if_changed,btfix) 29 67 30 ifeq ($(CONFIG_XIP_DEFLATED_DATA),y) << 31 quiet_cmd_mkxip = XIPZ $@ << 32 cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xi << 33 else << 34 quiet_cmd_mkxip = $(quiet_cmd_objcopy) << 35 cmd_mkxip = $(cmd_objcopy) << 36 endif 68 endif 37 69 38 $(obj)/xipImage: vmlinux FORCE !! 70 ifeq ($(CONFIG_SPARC64),y) 39 $(call if_changed,mkxip) !! 71 quiet_cmd_piggy = PIGGY $@ 40 @$(kecho) ' Physical Address of xipIm !! 72 cmd_piggy = $(obj)/piggyback_64 $@ System.map $(ROOT_IMG) 41 !! 73 quiet_cmd_strip = STRIP $@ 42 $(obj)/Image $(obj)/zImage: FORCE !! 74 cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start vmlinux -o $@ 43 @echo 'Kernel configured for XIP (CONF !! 75 44 @echo 'Only the xipImage target is ava !! 76 45 @false !! 77 # Actual linking 46 !! 78 $(obj)/image: vmlinux FORCE 47 else !! 79 $(call if_changed,strip) 48 !! 80 @echo ' kernel: $@ is ready' 49 $(obj)/xipImage: FORCE !! 81 50 @echo 'Kernel not configured for XIP ( !! 82 $(obj)/zImage: $(obj)/image 51 @false !! 83 $(call if_changed,gzip) 52 !! 84 53 $(obj)/Image: vmlinux FORCE !! 85 $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE 54 $(call if_changed,objcopy) !! 86 $(call if_changed,elftoaout) 55 !! 87 $(call if_changed,piggy) 56 $(obj)/compressed/vmlinux: $(obj)/Image FORCE !! 88 @echo ' kernel: $@ is ready' 57 $(Q)$(MAKE) $(build)=$(obj)/compressed !! 89 58 !! 90 $(obj)/vmlinux.aout: vmlinux FORCE 59 $(obj)/zImage: $(obj)/compressed/vmlinux FORC !! 91 $(call if_changed,elftoaout) 60 $(call if_changed,objcopy) !! 92 @echo ' kernel: $@ is ready' 61 << 62 endif 93 endif 63 94 64 ifneq ($(LOADADDR),) << 65 UIMAGE_LOADADDR=$(LOADADDR) << 66 else << 67 ifeq ($(CONFIG_ZBOOT_ROM),y) << 68 UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) << 69 else << 70 UIMAGE_LOADADDR=$(ZRELADDR) << 71 endif << 72 endif << 73 << 74 check_for_multiple_loadaddr = \ << 75 if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then << 76 echo 'multiple (or no) load addresses: << 77 echo 'This is incompatible with uImage << 78 echo 'Specify LOADADDR on the commandl << 79 false; \ << 80 fi << 81 << 82 $(obj)/uImage: $(obj)/zImage FORCE << 83 @$(check_for_multiple_loadaddr) << 84 $(call if_changed,uimage) << 85 << 86 $(obj)/bootp/bootp: $(obj)/zImage FORCE << 87 $(Q)$(MAKE) $(build)=$(obj)/bootp $@ << 88 << 89 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE << 90 $(call if_changed,objcopy) << 91 << 92 subdir- := bootp compressed dts <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.