11da177e4SLinus Torvalds# 21da177e4SLinus Torvalds# arch/alpha/boot/Makefile 31da177e4SLinus Torvalds# 41da177e4SLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public 51da177e4SLinus Torvalds# License. See the file "COPYING" in the main directory of this archive 61da177e4SLinus Torvalds# for more details. 71da177e4SLinus Torvalds# 81da177e4SLinus Torvalds# Copyright (C) 1994 by Linus Torvalds 91da177e4SLinus Torvalds# 101da177e4SLinus Torvalds 115f2fb52fSMasahiro Yamadahostprogs := tools/mkbb tools/objstrip 121da177e4SLinus Torvaldstargets := vmlinux.gz vmlinux \ 131da177e4SLinus Torvalds vmlinux.nh tools/lxboot tools/bootlx tools/bootph \ 141da177e4SLinus Torvalds tools/bootpzh bootloader bootpheader bootpzheader 151da177e4SLinus TorvaldsOBJSTRIP := $(obj)/tools/objstrip 161da177e4SLinus Torvalds 1796f14fe7SLaura AbbottKBUILD_HOSTCFLAGS := -Wall -I$(objtree)/usr/include 1858ab5e0cSArnd BergmannBOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) 1923430603SHelge Deller 201da177e4SLinus Torvalds# SRM bootable image. Copy to offset 512 of a partition. 211da177e4SLinus Torvalds$(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh 221da177e4SLinus Torvalds ( cat $(obj)/tools/lxboot $(obj)/tools/bootlx $(obj)/vmlinux.nh ) > $@ 231da177e4SLinus Torvalds $(obj)/tools/mkbb $@ $(obj)/tools/lxboot 241da177e4SLinus Torvalds @echo ' Bootimage $@ is ready' 251da177e4SLinus Torvalds 261da177e4SLinus Torvalds# BOOTP bootable image. Define INITRD during make to append initrd image. 271da177e4SLinus Torvalds$(obj)/bootpfile: $(obj)/tools/bootph $(obj)/vmlinux.nh 281da177e4SLinus Torvalds cat $(obj)/tools/bootph $(obj)/vmlinux.nh > $@ 291da177e4SLinus Torvaldsifdef INITRD 301da177e4SLinus Torvalds cat $(INITRD) >> $@ 311da177e4SLinus Torvaldsendif 321da177e4SLinus Torvalds 331da177e4SLinus Torvalds# Compressed kernel BOOTP bootable image. 341da177e4SLinus Torvalds# Define INITRD during make to append initrd image. 351da177e4SLinus Torvalds$(obj)/bootpzfile: $(obj)/tools/bootpzh $(obj)/vmlinux.nh.gz 361da177e4SLinus Torvalds cat $(obj)/tools/bootpzh $(obj)/vmlinux.nh.gz > $@ 371da177e4SLinus Torvaldsifdef INITRD 381da177e4SLinus Torvalds cat $(INITRD) >> $@ 391da177e4SLinus Torvaldsendif 401da177e4SLinus Torvalds 411da177e4SLinus Torvalds# Compressed kernel image 421da177e4SLinus Torvalds$(obj)/vmlinux.gz: $(obj)/vmlinux FORCE 431da177e4SLinus Torvalds $(call if_changed,gzip) 441da177e4SLinus Torvalds @echo ' Kernel $@ is ready' 451da177e4SLinus Torvalds 461da177e4SLinus Torvalds$(obj)/main.o: $(obj)/ksize.h 471da177e4SLinus Torvalds$(obj)/bootp.o: $(obj)/ksize.h 481da177e4SLinus Torvalds$(obj)/bootpz.o: $(obj)/kzsize.h 491da177e4SLinus Torvalds 501da177e4SLinus Torvalds$(obj)/ksize.h: $(obj)/vmlinux.nh FORCE 511da177e4SLinus Torvalds echo "#define KERNEL_SIZE `ls -l $(obj)/vmlinux.nh | awk '{print $$5}'`" > $@T 521da177e4SLinus Torvaldsifdef INITRD 531da177e4SLinus Torvalds [ -f $(INITRD) ] || exit 1 541da177e4SLinus Torvalds echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T 551da177e4SLinus Torvaldsendif 561da177e4SLinus Torvalds cmp -s $@T $@ || mv -f $@T $@ 571da177e4SLinus Torvalds rm -f $@T 581da177e4SLinus Torvalds 591da177e4SLinus Torvalds$(obj)/kzsize.h: $(obj)/vmlinux.nh.gz FORCE 601da177e4SLinus Torvalds echo "#define KERNEL_SIZE `ls -l $(obj)/vmlinux.nh | awk '{print $$5}'`" > $@T 611da177e4SLinus Torvalds echo "#define KERNEL_Z_SIZE `ls -l $(obj)/vmlinux.nh.gz | awk '{print $$5}'`" >> $@T 621da177e4SLinus Torvaldsifdef INITRD 631da177e4SLinus Torvalds [ -f $(INITRD) ] || exit 1 641da177e4SLinus Torvalds echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T 651da177e4SLinus Torvaldsendif 661da177e4SLinus Torvalds cmp -s $@T $@ || mv -f $@T $@ 671da177e4SLinus Torvalds rm -f $@T 681da177e4SLinus Torvalds 691da177e4SLinus Torvaldsquiet_cmd_strip = STRIP $@ 701da177e4SLinus Torvalds cmd_strip = $(STRIP) -o $@ $< 711da177e4SLinus Torvalds 721da177e4SLinus Torvalds$(obj)/vmlinux: vmlinux FORCE 731da177e4SLinus Torvalds $(call if_changed,strip) 741da177e4SLinus Torvalds 751da177e4SLinus Torvaldsquiet_cmd_objstrip = OBJSTRIP $@ 761da177e4SLinus Torvalds cmd_objstrip = $(OBJSTRIP) $(OSFLAGS_$(@F)) $< $@ 771da177e4SLinus Torvalds 781da177e4SLinus TorvaldsOSFLAGS_vmlinux.nh := -v 791da177e4SLinus TorvaldsOSFLAGS_lxboot := -p 801da177e4SLinus TorvaldsOSFLAGS_bootlx := -vb 811da177e4SLinus TorvaldsOSFLAGS_bootph := -vb 821da177e4SLinus TorvaldsOSFLAGS_bootpzh := -vb 831da177e4SLinus Torvalds 841da177e4SLinus Torvalds$(obj)/vmlinux.nh: vmlinux $(OBJSTRIP) FORCE 851da177e4SLinus Torvalds $(call if_changed,objstrip) 861da177e4SLinus Torvalds 871da177e4SLinus Torvalds$(obj)/vmlinux.nh.gz: $(obj)/vmlinux.nh FORCE 881da177e4SLinus Torvalds $(call if_changed,gzip) 891da177e4SLinus Torvalds 901da177e4SLinus Torvalds$(obj)/tools/lxboot: $(obj)/bootloader $(OBJSTRIP) FORCE 911da177e4SLinus Torvalds $(call if_changed,objstrip) 921da177e4SLinus Torvalds 931da177e4SLinus Torvalds$(obj)/tools/bootlx: $(obj)/bootloader $(OBJSTRIP) FORCE 941da177e4SLinus Torvalds $(call if_changed,objstrip) 951da177e4SLinus Torvalds 961da177e4SLinus Torvalds$(obj)/tools/bootph: $(obj)/bootpheader $(OBJSTRIP) FORCE 971da177e4SLinus Torvalds $(call if_changed,objstrip) 981da177e4SLinus Torvalds 991da177e4SLinus Torvalds$(obj)/tools/bootpzh: $(obj)/bootpzheader $(OBJSTRIP) FORCE 1001da177e4SLinus Torvalds $(call if_changed,objstrip) 1011da177e4SLinus Torvalds 10223430603SHelge DellerLDFLAGS_bootloader := -static -T # -N -relax 10323430603SHelge DellerLDFLAGS_bootloader := -static -T # -N -relax 10423430603SHelge DellerLDFLAGS_bootpheader := -static -T # -N -relax 10523430603SHelge DellerLDFLAGS_bootpzheader := -static -T # -N -relax 1061da177e4SLinus Torvalds 10723430603SHelge DellerOBJ_bootlx := $(obj)/head.o $(obj)/stdio.o $(obj)/main.o 10823430603SHelge DellerOBJ_bootph := $(obj)/head.o $(obj)/stdio.o $(obj)/bootp.o 10923430603SHelge DellerOBJ_bootpzh := $(obj)/head.o $(obj)/stdio.o $(obj)/bootpz.o $(obj)/misc.o 1101da177e4SLinus Torvalds 111135db3ebSMeelis Roos$(obj)/bootloader: $(obj)/bootloader.lds $(OBJ_bootlx) $(LIBS_Y) FORCE 1121da177e4SLinus Torvalds $(call if_changed,ld) 1131da177e4SLinus Torvalds 1141da177e4SLinus Torvalds$(obj)/bootpheader: $(obj)/bootloader.lds $(OBJ_bootph) $(LIBS_Y) FORCE 1151da177e4SLinus Torvalds $(call if_changed,ld) 1161da177e4SLinus Torvalds 1171da177e4SLinus Torvalds$(obj)/bootpzheader: $(obj)/bootloader.lds $(OBJ_bootpzh) $(LIBS_Y) FORCE 1181da177e4SLinus Torvalds $(call if_changed,ld) 1191da177e4SLinus Torvalds 1201da177e4SLinus Torvalds$(obj)/misc.o: lib/inflate.c 121