1 # 1 # >> 2 # arch/alpha/boot/Makefile >> 3 # 2 # This file is subject to the terms and condit 4 # This file is subject to the terms and conditions of the GNU General Public 3 # License. See the file "COPYING" in the main 5 # License. See the file "COPYING" in the main directory of this archive 4 # for more details. 6 # for more details. 5 # 7 # 6 # Copyright (C) 1995, 1998, 2001, 2002 by Ralf !! 8 # Copyright (C) 1994 by Linus Torvalds 7 # Copyright (C) 2004 Maciej W. Rozycki << 8 # 9 # 9 !! 10 # Creating a compressed kernel image (arch/alpha/boot/vmlinux.gz) >> 11 # is done via: 10 # 12 # 11 # Some DECstations need all possible sections !! 13 # make boot 12 # 14 # 13 ifdef CONFIG_MACH_DECSTATION !! 15 # Creating a BOOTP image (arch/alpha/boot/bootpfile or bootpzfile) 14 e2eflag := -a !! 16 # is done via: 15 endif !! 17 # 16 !! 18 # make bootpfile # using an uncompressed kernel >> 19 # make bootpzfile # using a compressed kernel 17 # 20 # 18 # Drop some uninteresting sections in the kern !! 21 # Adding an INITRD image to a BOOTP file (arch/alpha/boot/bootpzfile) 19 # This is only relevant for ELF kernels but do !! 22 # can be done, e.g, via: 20 # 23 # 21 drop-sections := .reginfo .mdebug .comment .no !! 24 # INITRD=`pwd`/initrd.img make bootpzfile 22 strip-flags := $(addprefix --remove-section= << 23 25 24 hostprogs := elf2ecoff !! 26 LINKFLAGS = -static -T bootloader.lds #-N -relax 25 27 26 suffix-y := bin !! 28 .S.s: 27 suffix-$(CONFIG_KERNEL_BZIP2) := bz2 !! 29 $(CPP) $(AFLAGS) -traditional -o $*.o $< 28 suffix-$(CONFIG_KERNEL_GZIP) := gz !! 30 .S.o: 29 suffix-$(CONFIG_KERNEL_LZMA) := lzma !! 31 $(CC) $(AFLAGS) -traditional -c -o $*.o $< 30 suffix-$(CONFIG_KERNEL_LZO) := lzo << 31 32 32 targets := vmlinux.ecoff !! 33 OBJECTS = head.o main.o 33 quiet_cmd_ecoff = ECOFF $@ !! 34 BPOBJECTS = head.o bootp.o 34 cmd_ecoff = $(obj)/elf2ecoff $(VMLINUX) !! 35 BPZOBJECTS = head.o bootpz.o misc.o 35 $(obj)/vmlinux.ecoff: $(obj)/elf2ecoff $(VMLIN !! 36 TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo 36 $(call if_changed,ecoff) !! 37 VMLINUX = $(TOPDIR)/vmlinux >> 38 OBJSTRIP = tools/objstrip 37 39 38 targets += vmlinux.bin !! 40 all: $(TARGETS) 39 quiet_cmd_bin = OBJCOPY $@ !! 41 @echo Ready to install kernel in $(shell pwd)/vmlinux.gz 40 cmd_bin = $(OBJCOPY) -O binary $(strip-f << 41 $(obj)/vmlinux.bin: $(VMLINUX) FORCE << 42 $(call if_changed,bin) << 43 42 44 targets += vmlinux.srec !! 43 # normally no need to build these: 45 quiet_cmd_srec = OBJCOPY $@ !! 44 rawboot: vmlinux.nh tools/lxboot tools/bootlx 46 cmd_srec = $(OBJCOPY) -S -O srec $(strip << 47 $(obj)/vmlinux.srec: $(VMLINUX) FORCE << 48 $(call if_changed,srec) << 49 45 50 UIMAGE_LOADADDR = $(VMLINUX_LOAD_ADDRESS) !! 46 msb: tools/lxboot tools/bootlx vmlinux.nh 51 UIMAGE_ENTRYADDR = $(VMLINUX_ENTRY_ADDRESS) !! 47 ( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a >> 48 disklabel -rw rz0 'linux' tools/lxboot tools/bootlx 52 49 53 # !! 50 bootimage: tools/mkbb tools/lxboot tools/bootlx vmlinux.nh 54 # Compressed vmlinux images !! 51 ( cat tools/lxboot tools/bootlx vmlinux.nh ) > bootimage 55 # !! 52 tools/mkbb bootimage tools/lxboot 56 53 57 extra-y += vmlinux.bin.bz2 !! 54 bootpfile: tools/bootph vmlinux.nh 58 extra-y += vmlinux.bin.gz !! 55 cat tools/bootph vmlinux.nh > bootpfile 59 extra-y += vmlinux.bin.lzma !! 56 ifdef INITRD 60 extra-y += vmlinux.bin.lzo !! 57 cat $(INITRD) >> bootpfile >> 58 endif 61 59 62 $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FOR !! 60 bootpzfile: tools/bootpzh vmlinux.nh.gz 63 $(call if_changed,bzip2) !! 61 cat tools/bootpzh vmlinux.nh.gz > bootpzfile >> 62 ifdef INITRD >> 63 cat $(INITRD) >> bootpzfile >> 64 endif 64 65 65 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORC !! 66 srmboot: bootdevice bootimage 66 $(call if_changed,gzip) !! 67 dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1 >> 68 tools/mkbb $(BOOTDEV) tools/lxboot 67 69 68 $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FO !! 70 bootdevice: 69 $(call if_changed,lzma) !! 71 @test "$(BOOTDEV)" != "" || (echo You must specify BOOTDEV ; exit -1) 70 72 71 $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FOR !! 73 vmlinux.gz: $(TOPDIR)/vmlinux 72 $(call if_changed,lzo) !! 74 gzip -fv9c $(TOPDIR)/vmlinux > vmlinux.gz 73 75 74 # !! 76 vmlinux.nh.gz: vmlinux.nh 75 # Compressed u-boot images !! 77 gzip -fv9c vmlinux.nh > vmlinux.nh.gz 76 # << 77 78 78 targets += uImage !! 79 main.o: ksize.h 79 targets += uImage.bin << 80 targets += uImage.bz2 << 81 targets += uImage.gz << 82 targets += uImage.lzma << 83 targets += uImage.lzo << 84 80 85 $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE !! 81 bootp.o: ksize.h 86 $(call if_changed,uimage,none) << 87 82 88 $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORC !! 83 bootpz.o: kzsize.h 89 $(call if_changed,uimage,bzip2) << 90 84 91 $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE !! 85 ksize.h: vmlinux.nh dummy 92 $(call if_changed,uimage,gzip) !! 86 echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T >> 87 ifdef INITRD >> 88 [ ! \( -f $(INITRD) \) ] || exit 1 >> 89 echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T >> 90 endif >> 91 cmp -s $@T $@ || mv -f $@T $@ >> 92 rm -f $@T 93 93 94 $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FO !! 94 kzsize.h: vmlinux.nh.gz dummy 95 $(call if_changed,uimage,lzma) !! 95 echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T >> 96 echo "#define KERNEL_Z_SIZE `ls -l vmlinux.nh.gz | awk '{print $$5}'`" >> $@T >> 97 ifdef INITRD >> 98 [ -f $(INITRD) ] || exit 1 >> 99 echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T >> 100 endif >> 101 cmp -s $@T $@ || mv -f $@T $@ >> 102 rm -f $@T 96 103 97 $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORC !! 104 vmlinux.nh: $(VMLINUX) $(OBJSTRIP) 98 $(call if_changed,uimage,lzo) !! 105 $(OBJSTRIP) -v $(VMLINUX) vmlinux.nh 99 106 100 $(obj)/uImage: $(obj)/uImage.$(suffix-y) !! 107 vmlinux: $(VMLINUX) 101 @ln -sf $(notdir $<) $@ !! 108 $(STRIP) -o vmlinux $(VMLINUX) 102 @echo ' Image $@ is ready' << 103 109 104 # !! 110 tools/lxboot: $(OBJSTRIP) bootloader 105 # Flattened Image Tree (.itb) images !! 111 $(OBJSTRIP) -p bootloader tools/lxboot 106 # << 107 112 108 ifeq ($(ADDR_BITS),32) !! 113 tools/bootlx: bootloader $(OBJSTRIP) 109 itb_addr_cells = 1 !! 114 $(OBJSTRIP) -vb bootloader tools/bootlx 110 endif !! 115 111 ifeq ($(ADDR_BITS),64) !! 116 tools/bootph: bootpheader $(OBJSTRIP) 112 itb_addr_cells = 2 !! 117 $(OBJSTRIP) -vb bootpheader tools/bootph 113 endif !! 118 >> 119 tools/bootpzh: bootpzheader $(OBJSTRIP) >> 120 $(OBJSTRIP) -vb bootpzheader tools/bootpzh >> 121 >> 122 $(OBJSTRIP): $(OBJSTRIP).c >> 123 $(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP) >> 124 >> 125 tools/mkbb: tools/mkbb.c >> 126 $(HOSTCC) tools/mkbb.c -o tools/mkbb 114 127 115 targets += vmlinux.its.S !! 128 bootloader: $(OBJECTS) >> 129 $(LD) $(LINKFLAGS) $(OBJECTS) $(LIBS) -o bootloader 116 130 117 quiet_cmd_its_cat = CAT $@ !! 131 bootpheader: $(BPOBJECTS) 118 cmd_its_cat = cat $(real-prereqs) >$@ !! 132 $(LD) $(LINKFLAGS) $(BPOBJECTS) $(LIBS) -o bootpheader 119 133 120 $(obj)/vmlinux.its.S: $(addprefix $(srctree)/a !! 134 bootpzheader: $(BPZOBJECTS) 121 $(call if_changed,its_cat) !! 135 $(LD) $(LINKFLAGS) $(BPZOBJECTS) $(LIBS) -o bootpzheader 122 136 123 targets += vmlinux.its !! 137 misc.o: misc.c $(TOPDIR)/lib/inflate.c 124 targets += vmlinux.gz.its << 125 targets += vmlinux.bz2.its << 126 targets += vmlinux.lzma.its << 127 targets += vmlinux.lzo.its << 128 << 129 quiet_cmd_cpp_its_S = ITS $@ << 130 cmd_cpp_its_S = $(CPP) -P -C -o $@ $< \ << 131 -DKERNEL_NAME="\"Linux << 132 -DVMLINUX_BINARY="\"$( << 133 -DVMLINUX_COMPRESSION= << 134 -DVMLINUX_LOAD_ADDRESS << 135 -DVMLINUX_ENTRY_ADDRES << 136 -DADDR_BITS=$(ADDR_BIT << 137 -DADDR_CELLS=$(itb_add << 138 << 139 $(obj)/vmlinux.its: $(obj)/vmlinux.its.S $(VML << 140 $(call if_changed,cpp_its_S,none,vmlin << 141 << 142 $(obj)/vmlinux.gz.its: $(obj)/vmlinux.its.S $( << 143 $(call if_changed,cpp_its_S,gzip,vmlin << 144 << 145 $(obj)/vmlinux.bz2.its: $(obj)/vmlinux.its.S $ << 146 $(call if_changed,cpp_its_S,bzip2,vmli << 147 << 148 $(obj)/vmlinux.lzma.its: $(obj)/vmlinux.its.S << 149 $(call if_changed,cpp_its_S,lzma,vmlin << 150 << 151 $(obj)/vmlinux.lzo.its: $(obj)/vmlinux.its.S $ << 152 $(call if_changed,cpp_its_S,lzo,vmlinu << 153 << 154 targets += vmlinux.itb << 155 targets += vmlinux.gz.itb << 156 targets += vmlinux.bz2.itb << 157 targets += vmlinux.lzma.itb << 158 targets += vmlinux.lzo.itb << 159 << 160 quiet_cmd_itb-image = ITB $@ << 161 cmd_itb-image = \ << 162 env PATH="$(objtree)/scripts/d << 163 $(BASH) $(MKIMAGE) \ << 164 -D "-I dts -O dtb -p 500 \ << 165 --include $(objtree)/a << 166 --warning no-unit_addr << 167 -f $(2) $@ << 168 138 169 $(obj)/vmlinux.itb: $(obj)/vmlinux.its $(obj)/ !! 139 clean: 170 $(call if_changed,itb-image,$<) !! 140 rm -f $(TARGETS) bootloader bootimage bootpfile bootpheader >> 141 rm -f tools/mkbb tools/bootlx tools/lxboot tools/bootph >> 142 rm -f vmlinux.nh ksize.h 171 143 172 $(obj)/vmlinux.%.itb: $(obj)/vmlinux.%.its $(o !! 144 dep: 173 $(call if_changed,itb-image,$<) << 174 145 175 # for cleaning !! 146 dummy: 176 subdir- += compressed tools <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.