1*b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 21da177e4SLinus Torvalds# Makefile for the Sparc boot stuff. 31da177e4SLinus Torvalds# 41da177e4SLinus Torvalds# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 51da177e4SLinus Torvalds# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) 61da177e4SLinus Torvalds 71da177e4SLinus TorvaldsROOT_IMG := /usr/src/root.img 81da177e4SLinus TorvaldsELFTOAOUT := elftoaout 91da177e4SLinus Torvalds 1051f19cfaSSam Ravnborghostprogs-y := piggyback 1151f19cfaSSam Ravnborgtargets := tftpboot.img image zImage vmlinux.aout 12c4893269SSam Ravnborgclean-files := System.map 131da177e4SLinus Torvalds 141da177e4SLinus Torvaldsquiet_cmd_elftoaout = ELFTOAOUT $@ 151da177e4SLinus Torvalds cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@ 1656818a6fSSam Ravnborgquiet_cmd_piggy = PIGGY $@ 1756818a6fSSam Ravnborg cmd_piggy = $(obj)/piggyback $(BITS) $@ System.map $(ROOT_IMG) 189202db22SSam Ravnborgquiet_cmd_strip = STRIP $@ 199202db22SSam Ravnborg cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@ 20a8c601caSSam Ravnborg 21a8c601caSSam Ravnborgifeq ($(CONFIG_SPARC64),y) 22a8c601caSSam Ravnborg 23a8c601caSSam Ravnborg# Actual linking 24a8c601caSSam Ravnborg 2548e46b7bSJurij Smakov$(obj)/zImage: $(obj)/image 2648e46b7bSJurij Smakov $(call if_changed,gzip) 279202db22SSam Ravnborg @echo ' kernel: $@ is ready' 2848e46b7bSJurij Smakov 29a8c601caSSam Ravnborg$(obj)/vmlinux.aout: vmlinux FORCE 30a8c601caSSam Ravnborg $(call if_changed,elftoaout) 31a8c601caSSam Ravnborg @echo ' kernel: $@ is ready' 32684151a7SDaniel Hellstromelse 33684151a7SDaniel Hellstrom 3451f19cfaSSam Ravnborg$(obj)/zImage: $(obj)/image 3551f19cfaSSam Ravnborg $(call if_changed,strip) 3651f19cfaSSam Ravnborg @echo ' kernel: $@ is ready' 3751f19cfaSSam Ravnborg 38684151a7SDaniel Hellstrom# The following lines make a readable image for U-Boot. 39684151a7SDaniel Hellstrom# uImage - Binary file read by U-boot 40684151a7SDaniel Hellstrom# uImage.o - object file of uImage for loading with a 41684151a7SDaniel Hellstrom# flash programmer understanding ELF. 42684151a7SDaniel Hellstrom 43684151a7SDaniel HellstromOBJCOPYFLAGS_image.bin := -S -O binary -R .note -R .comment 44684151a7SDaniel Hellstrom$(obj)/image.bin: $(obj)/image FORCE 45684151a7SDaniel Hellstrom $(call if_changed,objcopy) 46684151a7SDaniel Hellstrom 47684151a7SDaniel Hellstrom$(obj)/image.gz: $(obj)/image.bin 48684151a7SDaniel Hellstrom $(call if_changed,gzip) 49684151a7SDaniel Hellstrom 50e3393645SStephen WarrenUIMAGE_LOADADDR = $(CONFIG_UBOOT_LOAD_ADDR) 51e3393645SStephen WarrenUIMAGE_ENTRYADDR = $(CONFIG_UBOOT_ENTRY_ADDR) 52e3393645SStephen WarrenUIMAGE_COMPRESSION = gzip 53684151a7SDaniel Hellstrom 54684151a7SDaniel Hellstromquiet_cmd_uimage.o = UIMAGE.O $@ 55684151a7SDaniel Hellstrom cmd_uimage.o = $(LD) -Tdata $(CONFIG_UBOOT_FLASH_ADDR) \ 56684151a7SDaniel Hellstrom -r -b binary $@ -o $@.o 57684151a7SDaniel Hellstrom 58684151a7SDaniel Hellstromtargets += uImage 59684151a7SDaniel Hellstrom$(obj)/uImage: $(obj)/image.gz 60684151a7SDaniel Hellstrom $(call if_changed,uimage) 61684151a7SDaniel Hellstrom $(call if_changed,uimage.o) 62684151a7SDaniel Hellstrom @echo ' Image $@ is ready' 63684151a7SDaniel Hellstrom 64a8c601caSSam Ravnborgendif 65a8c601caSSam Ravnborg 6651f19cfaSSam Ravnborg$(obj)/image: vmlinux FORCE 6751f19cfaSSam Ravnborg $(call if_changed,strip) 6851f19cfaSSam Ravnborg @echo ' kernel: $@ is ready' 6951f19cfaSSam Ravnborg 7056818a6fSSam Ravnborg$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE 7156818a6fSSam Ravnborg $(call if_changed,elftoaout) 7256818a6fSSam Ravnborg $(call if_changed,piggy) 73c78f77e2SDavid L Stevens 74c78f77e2SDavid L Stevensinstall: 75c78f77e2SDavid L Stevens sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/zImage \ 76c78f77e2SDavid L Stevens System.map "$(INSTALL_PATH)" 77