ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / x86_64 / boot / Makefile
1 #
2 # arch/x86_64/boot/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8 # Copyright (C) 1994 by Linus Torvalds
9 #
10
11 # ROOT_DEV specifies the default root-device when making the image.
12 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
13 # the default of FLOPPY is used by 'build'.
14
15 ROOT_DEV := CURRENT
16
17 # If you want to preset the SVGA mode, uncomment the next line and
18 # set SVGA_MODE to whatever number you want.
19 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
20 # The number is the same as you would ordinarily press at bootup.
21
22 SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
23
24 # If you want the RAM disk device, define this to be the size in blocks.
25
26 #RAMDISK := -DRAMDISK=512
27
28 targets         := vmlinux.bin bootsect bootsect.o \
29                    setup setup.o bzImage mtools.conf
30
31 EXTRA_CFLAGS := -m32
32
33 host-progs      := tools/build
34 subdir-         := compressed/  #Let make clean descend in compressed/
35 # ---------------------------------------------------------------------------
36
37 $(obj)/bzImage: IMAGE_OFFSET := 0x100000
38 $(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
39 $(obj)/bzImage: BUILDFLAGS   := -b
40
41 quiet_cmd_image = BUILD   $@
42 cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
43             $(obj)/vmlinux.bin $(ROOT_DEV) > $@
44
45 $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
46                               $(obj)/vmlinux.bin $(obj)/tools/build FORCE
47         $(call if_changed,image)
48         @echo 'Kernel: $@ is ready'
49
50 $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
51         $(call if_changed,objcopy)
52
53 LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
54 LDFLAGS_setup    := -Ttext 0x0 -s --oformat binary -e begtext
55
56 $(obj)/setup $(obj)/bootsect: %: %.o FORCE
57         $(call if_changed,ld)
58
59 $(obj)/compressed/vmlinux: FORCE
60         $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
61
62 # Set this if you want to pass append arguments to the zdisk/fdimage kernel
63 FDARGS = 
64
65 $(obj)/mtools.conf: $(src)/mtools.conf.in
66         sed -e 's|@OBJ@|$(obj)|g' < $< > $@
67
68 # This requires write access to /dev/fd0
69 zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
70         MTOOLSRC=$(obj)/mtools.conf mformat a:                  ; sync
71         syslinux /dev/fd0                                       ; sync
72         echo 'default linux $(FDARGS)' | \
73                 MTOOLSRC=$(obj)/mtools.conf mcopy - a:syslinux.cfg
74         MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux  ; sync
75
76 # These require being root or having syslinux 2.02 or higher installed
77 fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
78         dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
79         MTOOLSRC=$(obj)/mtools.conf mformat v:                  ; sync
80         syslinux $(obj)/fdimage                                 ; sync
81         echo 'default linux $(FDARGS)' | \
82                 MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
83         MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux  ; sync
84
85 fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
86         dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
87         MTOOLSRC=$(obj)/mtools.conf mformat w:                  ; sync
88         syslinux $(obj)/fdimage                                 ; sync
89         echo 'default linux $(FDARGS)' | \
90                 MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
91         MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux  ; sync
92
93 zlilo: $(BOOTIMAGE)
94         if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
95         if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
96         cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
97         cp System.map $(INSTALL_PATH)/
98         if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
99
100 install: $(BOOTIMAGE)
101         sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"