Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 # Makefile for the Sparc boot stuff.
0003 #
0004 # Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
0005 # Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
0006 
0007 ROOT_IMG        := /usr/src/root.img
0008 ELFTOAOUT       := elftoaout
0009 
0010 hostprogs       := piggyback
0011 targets         := tftpboot.img image zImage vmlinux.aout
0012 clean-files     := System.map
0013 
0014 quiet_cmd_elftoaout     = ELFTOAOUT $@
0015       cmd_elftoaout     = $(ELFTOAOUT) $(obj)/image -o $@
0016 quiet_cmd_piggy         = PIGGY   $@
0017       cmd_piggy         = $(obj)/piggyback $(BITS) $@ System.map $(ROOT_IMG)
0018 quiet_cmd_strip         = STRIP   $@
0019       cmd_strip         = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@
0020 
0021 ifeq ($(CONFIG_SPARC64),y)
0022 
0023 # Actual linking
0024 
0025 $(obj)/zImage: $(obj)/image FORCE
0026         $(call if_changed,gzip)
0027         @echo '  kernel: $@ is ready'
0028 
0029 $(obj)/vmlinux.aout: vmlinux FORCE
0030         $(call if_changed,elftoaout)
0031         @echo '  kernel: $@ is ready'
0032 else
0033 
0034 $(obj)/zImage: $(obj)/image FORCE
0035         $(call if_changed,strip)
0036         @echo '  kernel: $@ is ready'
0037 
0038 # The following lines make a readable image for U-Boot.
0039 #  uImage   - Binary file read by U-boot
0040 #  uImage.o - object file of uImage for loading with a
0041 #             flash programmer understanding ELF.
0042 
0043 OBJCOPYFLAGS_image.bin := -S -O binary -R .note -R .comment
0044 $(obj)/image.bin: $(obj)/image FORCE
0045         $(call if_changed,objcopy)
0046 
0047 $(obj)/image.gz: $(obj)/image.bin FORCE
0048         $(call if_changed,gzip)
0049 
0050 UIMAGE_LOADADDR = $(CONFIG_UBOOT_LOAD_ADDR)
0051 UIMAGE_ENTRYADDR = $(CONFIG_UBOOT_ENTRY_ADDR)
0052 UIMAGE_COMPRESSION = gzip
0053 
0054 quiet_cmd_uimage.o = UIMAGE.O $@
0055       cmd_uimage.o = $(LD) -Tdata $(CONFIG_UBOOT_FLASH_ADDR) \
0056                      -r -b binary $@ -o $@.o
0057 
0058 targets += uImage
0059 $(obj)/uImage: $(obj)/image.gz FORCE
0060         $(call if_changed,uimage)
0061         $(call if_changed,uimage.o)
0062         @echo '  Image $@ is ready'
0063 
0064 endif
0065 
0066 $(obj)/image: vmlinux FORCE
0067         $(call if_changed,strip)
0068         @echo '  kernel: $@ is ready'
0069 
0070 $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
0071         $(call if_changed,elftoaout)
0072         $(call if_changed,piggy)