1b2441318SGreg 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 105f2fb52fSMasahiro Yamadahostprogs := 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 25a3c7ca2bSKees Cook$(obj)/zImage: $(obj)/image FORCE 2648e46b7bSJurij Smakov $(call if_changed,gzip) 27*e183130cSUwe Kleine-König @$(kecho) 'Kernel: $@ is ready' '(#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')' 2848e46b7bSJurij Smakov 29a8c601caSSam Ravnborg$(obj)/vmlinux.aout: vmlinux FORCE 30a8c601caSSam Ravnborg $(call if_changed,elftoaout) 31*e183130cSUwe Kleine-König @$(kecho) 'Kernel: $@ is ready' '(#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')' 32684151a7SDaniel Hellstromelse 33684151a7SDaniel Hellstrom 34a3c7ca2bSKees Cook$(obj)/zImage: $(obj)/image FORCE 3551f19cfaSSam Ravnborg $(call if_changed,strip) 36*e183130cSUwe Kleine-König @$(kecho) 'Kernel: $@ is ready' '(#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')' 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 47a3c7ca2bSKees Cook$(obj)/image.gz: $(obj)/image.bin FORCE 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 59a3c7ca2bSKees Cook$(obj)/uImage: $(obj)/image.gz FORCE 60684151a7SDaniel Hellstrom $(call if_changed,uimage) 61684151a7SDaniel Hellstrom $(call if_changed,uimage.o) 62*e183130cSUwe Kleine-König @$(kecho) 'Kernel: $@ is ready' '(#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')' 63684151a7SDaniel Hellstrom 64a8c601caSSam Ravnborgendif 65a8c601caSSam Ravnborg 6651f19cfaSSam Ravnborg$(obj)/image: vmlinux FORCE 6751f19cfaSSam Ravnborg $(call if_changed,strip) 68*e183130cSUwe Kleine-König @$(kecho) 'Kernel: $@ is ready' '(#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')' 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) 73