Makefile 3.4 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4 5 6 7 8 9 10
#
# arch/i386/boot/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# ROOT_DEV specifies the default root-device when making the image.
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
# the default of FLOPPY is used by 'build'.

ROOT_DEV := CURRENT

# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.

SVGA_MODE := -DSVGA_MODE=NORMAL_VGA

# If you want the RAM disk device, define this to be the size in blocks.

RAMDISK := -DRAMDISK=512

# ---------------------------------------------------------------------------

Linus Torvalds's avatar
Linus Torvalds committed
30 31 32 33
BOOT_INCL =	$(TOPDIR)/include/linux/config.h \
		$(TOPDIR)/include/linux/autoconf.h \
		$(TOPDIR)/include/asm/boot.h

34
zImage: bootsect setup compressed/vmlinux tools/build
Linus Torvalds's avatar
Linus Torvalds committed
35 36 37
	$(OBJCOPY) compressed/vmlinux compressed/vmlinux.out
	tools/build bootsect setup compressed/vmlinux.out $(ROOT_DEV) > zImage

38
bzImage: bbootsect bsetup compressed/bvmlinux tools/build
Linus Torvalds's avatar
Linus Torvalds committed
39 40 41 42 43 44 45 46 47 48 49 50
	$(OBJCOPY) compressed/bvmlinux compressed/bvmlinux.out
	tools/build -b bbootsect bsetup compressed/bvmlinux.out $(ROOT_DEV) > bzImage

compressed/vmlinux: $(TOPDIR)/vmlinux
	@$(MAKE) -C compressed vmlinux

compressed/bvmlinux: $(TOPDIR)/vmlinux
	@$(MAKE) -C compressed bvmlinux

zdisk: $(BOOTIMAGE)
	dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0

51
zlilo: $(BOOTIMAGE)
Linus Torvalds's avatar
Linus Torvalds committed
52 53 54 55 56 57
	if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
	if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
	cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
	cp $(TOPDIR)/System.map $(INSTALL_PATH)/
	if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi

58
install: $(BOOTIMAGE)
Linus Torvalds's avatar
Linus Torvalds committed
59 60 61 62 63 64
	sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)"

tools/build: tools/build.c
	$(HOSTCC) $(HOSTCFLAGS) -o $@ $< -I$(TOPDIR)/include

bootsect: bootsect.o
Linus Torvalds's avatar
Linus Torvalds committed
65
	$(LD) -Ttext 0x0 -s --oformat binary -o $@ $<
Linus Torvalds's avatar
Linus Torvalds committed
66 67 68 69 70 71 72 73

bootsect.o: bootsect.s
	$(AS) -o $@ $<

bootsect.s: bootsect.S Makefile $(BOOT_INCL)
	$(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@

bbootsect: bbootsect.o
Linus Torvalds's avatar
Linus Torvalds committed
74
	$(LD) -Ttext 0x0 -s --oformat binary $< -o $@
Linus Torvalds's avatar
Linus Torvalds committed
75 76 77 78 79 80 81 82

bbootsect.o: bbootsect.s
	$(AS) -o $@ $<

bbootsect.s: bootsect.S Makefile $(BOOT_INCL)
	$(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@

setup: setup.o
Linus Torvalds's avatar
Linus Torvalds committed
83
	$(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
Linus Torvalds's avatar
Linus Torvalds committed
84 85 86 87 88

setup.o: setup.s
	$(AS) -o $@ $<

setup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h
Linus Torvalds's avatar
Linus Torvalds committed
89
	$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
Linus Torvalds's avatar
Linus Torvalds committed
90 91

bsetup: bsetup.o
Linus Torvalds's avatar
Linus Torvalds committed
92
	$(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
Linus Torvalds's avatar
Linus Torvalds committed
93 94 95 96 97

bsetup.o: bsetup.s
	$(AS) -o $@ $<

bsetup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h
Linus Torvalds's avatar
Linus Torvalds committed
98
	$(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -D__ASSEMBLY__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
Linus Torvalds's avatar
Linus Torvalds committed
99 100 101 102

dep:

clean:
103 104 105 106
	@echo 'Cleaning up (boot)'
	@rm -f tools/build
	@rm -f setup bootsect zImage compressed/vmlinux.out
	@rm -f bsetup bbootsect bzImage compressed/bvmlinux.out
Linus Torvalds's avatar
Linus Torvalds committed
107
	@$(MAKE) -C compressed clean