1 # 1 # 2 # arch/sh/boot/Makefile !! 2 # arch/alpha/boot/Makefile 3 # 3 # 4 # This file is subject to the terms and condit 4 # This file is subject to the terms and conditions of the GNU General Public 5 # License. See the file "COPYING" in the main 5 # License. See the file "COPYING" in the main directory of this archive 6 # for more details. 6 # for more details. 7 # 7 # 8 # Copyright (C) 1999 Stuart Menefy !! 8 # Copyright (C) 1994 by Linus Torvalds 9 # 9 # 10 !! 10 # Creating a compressed kernel image (arch/alpha/boot/vmlinux.gz) >> 11 # is done via: >> 12 # >> 13 # make boot >> 14 # >> 15 # Creating a BOOTP image (arch/alpha/boot/bootpfile or bootpzfile) >> 16 # is done via: 11 # 17 # 12 # Assign safe dummy values if these variables !! 18 # make bootpfile # using an uncompressed kernel 13 # in order to suppress error message. !! 19 # make bootpzfile # using a compressed kernel 14 # 20 # 15 CONFIG_PAGE_OFFSET ?= 0x80000000 !! 21 # Adding an INITRD image to a BOOTP file (arch/alpha/boot/bootpzfile) 16 CONFIG_MEMORY_START ?= 0x0c000000 !! 22 # can be done, e.g, via: 17 CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 !! 23 # 18 CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000 !! 24 # INITRD=`pwd`/initrd.img make bootpzfile 19 CONFIG_ENTRY_OFFSET ?= 0x00001000 !! 25 20 CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_STA !! 26 LINKFLAGS = -static -T bootloader.lds #-N -relax >> 27 >> 28 .S.s: >> 29 $(CPP) $(AFLAGS) -traditional -o $*.o $< >> 30 .S.o: >> 31 $(CC) $(AFLAGS) -traditional -c -o $*.o $< >> 32 >> 33 OBJECTS = head.o main.o >> 34 BPOBJECTS = head.o bootp.o >> 35 BPZOBJECTS = head.o bootpz.o misc.o >> 36 TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo >> 37 VMLINUX = $(TOPDIR)/vmlinux >> 38 OBJSTRIP = tools/objstrip >> 39 >> 40 all: $(TARGETS) >> 41 @echo Ready to install kernel in $(shell pwd)/vmlinux.gz >> 42 >> 43 # normally no need to build these: >> 44 rawboot: vmlinux.nh tools/lxboot tools/bootlx >> 45 >> 46 msb: tools/lxboot tools/bootlx vmlinux.nh >> 47 ( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a >> 48 disklabel -rw rz0 'linux' tools/lxboot tools/bootlx >> 49 >> 50 bootimage: tools/mkbb tools/lxboot tools/bootlx vmlinux.nh >> 51 ( cat tools/lxboot tools/bootlx vmlinux.nh ) > bootimage >> 52 tools/mkbb bootimage tools/lxboot 21 53 22 suffix_y := bin !! 54 bootpfile: tools/bootph vmlinux.nh 23 suffix_$(CONFIG_KERNEL_GZIP) := gz !! 55 cat tools/bootph vmlinux.nh > bootpfile 24 suffix_$(CONFIG_KERNEL_BZIP2) := bz2 !! 56 ifdef INITRD 25 suffix_$(CONFIG_KERNEL_LZMA) := lzma !! 57 cat $(INITRD) >> bootpfile 26 suffix_$(CONFIG_KERNEL_XZ) := xz !! 58 endif 27 suffix_$(CONFIG_KERNEL_LZO) := lzo << 28 59 29 targets := zImage vmlinux.srec romImage uImage !! 60 bootpzfile: tools/bootpzh vmlinux.nh.gz 30 uImage.bz2 uImage.lzma uImage.xz uI !! 61 cat tools/bootpzh vmlinux.nh.gz > bootpzfile 31 vmlinux.bin vmlinux.bin.gz vmlinux. !! 62 ifdef INITRD 32 vmlinux.bin.xz vmlinux.bin.lzo !! 63 cat $(INITRD) >> bootpzfile 33 subdir- := compressed romimage !! 64 endif 34 65 35 $(obj)/zImage: $(obj)/compressed/vmlinux FORCE !! 66 srmboot: bootdevice bootimage 36 $(call if_changed,objcopy) !! 67 dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1 37 @echo ' Kernel: $@ is ready' !! 68 tools/mkbb $(BOOTDEV) tools/lxboot 38 69 39 $(obj)/compressed/vmlinux: FORCE !! 70 bootdevice: 40 $(Q)$(MAKE) $(build)=$(obj)/compressed !! 71 @test "$(BOOTDEV)" != "" || (echo You must specify BOOTDEV ; exit -1) 41 72 42 $(obj)/romImage: $(obj)/romimage/vmlinux FORCE !! 73 vmlinux.gz: $(TOPDIR)/vmlinux 43 $(call if_changed,objcopy) !! 74 gzip -fv9c $(TOPDIR)/vmlinux > vmlinux.gz 44 @echo ' Kernel: $@ is ready' << 45 75 46 $(obj)/romimage/vmlinux: $(obj)/zImage FORCE !! 76 vmlinux.nh.gz: vmlinux.nh 47 $(Q)$(MAKE) $(build)=$(obj)/romimage $ !! 77 gzip -fv9c vmlinux.nh > vmlinux.nh.gz 48 78 49 KERNEL_MEMORY := $(shell /bin/bash -c 'print !! 79 main.o: ksize.h 50 $$[$(CONFIG_PHYSICAL_STAR << 51 80 52 KERNEL_LOAD := $(shell /bin/bash -c 'print !! 81 bootp.o: ksize.h 53 $$[$(CONFIG_PAGE_OFFSET) << 54 $(KERNEL_MEMORY) + \ << 55 $(CONFIG_ZERO_PAGE_OFF << 56 82 57 KERNEL_ENTRY := $(shell /bin/bash -c 'print !! 83 bootpz.o: kzsize.h 58 $$[$(CONFIG_PAGE_OFFSET) << 59 $(KERNEL_MEMORY) + \ << 60 $(CONFIG_ZERO_PAGE_OFF << 61 84 62 UIMAGE_LOADADDR = $(KERNEL_LOAD) !! 85 ksize.h: vmlinux.nh dummy 63 UIMAGE_ENTRYADDR = $(KERNEL_ENTRY) !! 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 64 93 65 $(obj)/vmlinux.bin: vmlinux FORCE !! 94 kzsize.h: vmlinux.nh.gz dummy 66 $(call if_changed,objcopy) !! 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 67 103 68 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORC !! 104 vmlinux.nh: $(VMLINUX) $(OBJSTRIP) 69 $(call if_changed,gzip) !! 105 $(OBJSTRIP) -v $(VMLINUX) vmlinux.nh 70 106 71 $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FOR !! 107 vmlinux: $(VMLINUX) 72 $(call if_changed,bzip2) !! 108 $(STRIP) -o vmlinux $(VMLINUX) 73 109 74 $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FO !! 110 tools/lxboot: $(OBJSTRIP) bootloader 75 $(call if_changed,lzma) !! 111 $(OBJSTRIP) -p bootloader tools/lxboot 76 112 77 $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORC !! 113 tools/bootlx: bootloader $(OBJSTRIP) 78 $(call if_changed,xzkern) !! 114 $(OBJSTRIP) -vb bootloader tools/bootlx 79 115 80 $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FOR !! 116 tools/bootph: bootpheader $(OBJSTRIP) 81 $(call if_changed,lzo) !! 117 $(OBJSTRIP) -vb bootpheader tools/bootph 82 118 83 $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORC !! 119 tools/bootpzh: bootpzheader $(OBJSTRIP) 84 $(call if_changed,uimage,bzip2) !! 120 $(OBJSTRIP) -vb bootpzheader tools/bootpzh 85 121 86 $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE !! 122 $(OBJSTRIP): $(OBJSTRIP).c 87 $(call if_changed,uimage,gzip) !! 123 $(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP) 88 124 89 $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FO !! 125 tools/mkbb: tools/mkbb.c 90 $(call if_changed,uimage,lzma) !! 126 $(HOSTCC) tools/mkbb.c -o tools/mkbb 91 127 92 $(obj)/uImage.xz: $(obj)/vmlinux.bin.xz FORCE !! 128 bootloader: $(OBJECTS) 93 $(call if_changed,uimage,xz) !! 129 $(LD) $(LINKFLAGS) $(OBJECTS) $(LIBS) -o bootloader 94 130 95 $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORC !! 131 bootpheader: $(BPOBJECTS) 96 $(call if_changed,uimage,lzo) !! 132 $(LD) $(LINKFLAGS) $(BPOBJECTS) $(LIBS) -o bootpheader 97 133 98 $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE !! 134 bootpzheader: $(BPZOBJECTS) 99 $(call if_changed,uimage,none) !! 135 $(LD) $(LINKFLAGS) $(BPZOBJECTS) $(LIBS) -o bootpzheader 100 136 101 OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec !! 137 misc.o: misc.c $(TOPDIR)/lib/inflate.c 102 $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux << 103 $(call if_changed,objcopy) << 104 138 105 OBJCOPYFLAGS_uImage.srec := -I binary -O srec !! 139 clean: 106 $(obj)/uImage.srec: $(obj)/uImage FORCE !! 140 rm -f $(TARGETS) bootloader bootimage bootpfile bootpheader 107 $(call if_changed,objcopy) !! 141 rm -f tools/mkbb tools/bootlx tools/lxboot tools/bootph >> 142 rm -f vmlinux.nh ksize.h 108 143 109 $(obj)/uImage: $(obj)/uImage.$(suffix_y) !! 144 dep: 110 @ln -sf $(notdir $<) $@ << 111 @echo ' Image $@ is ready' << 112 145 113 export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START !! 146 dummy: 114 CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_ << 115 KERNEL_MEMORY suffix_y <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.