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