Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #
  2. # arch/i386/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. # ROOT_DEV specifies the default root-device when making the image.
  11. # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
  12. # the default of FLOPPY is used by 'build'.
  13. ROOT_DEV := CURRENT
  14. # If you want to preset the SVGA mode, uncomment the next line and
  15. # set SVGA_MODE to whatever number you want.
  16. # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
  17. # The number is the same as you would ordinarily press at bootup.
  18. SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
  19. # If you want the RAM disk device, define this to be the size in blocks.
  20. #RAMDISK := -DRAMDISK=512
  21. targets := vmlinux.bin bootsect bootsect.o \
  22. setup setup.o zImage bzImage
  23. subdir- := compressed
  24. hostprogs-y := tools/build
  25. HOSTCFLAGS_build.o := $(LINUXINCLUDE)
  26. # ---------------------------------------------------------------------------
  27. $(obj)/zImage: IMAGE_OFFSET := 0x1000
  28. $(obj)/zImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK)
  29. $(obj)/bzImage: IMAGE_OFFSET := 0x100000
  30. $(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
  31. $(obj)/bzImage: BUILDFLAGS := -b
  32. quiet_cmd_image = BUILD $@
  33. cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
  34. $(obj)/vmlinux.bin $(ROOT_DEV) > $@
  35. $(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
  36. $(obj)/vmlinux.bin $(obj)/tools/build FORCE
  37. $(call if_changed,image)
  38. @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
  39. $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
  40. $(call if_changed,objcopy)
  41. LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
  42. LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext
  43. $(obj)/setup $(obj)/bootsect: %: %.o FORCE
  44. $(call if_changed,ld)
  45. $(obj)/compressed/vmlinux: FORCE
  46. $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
  47. # Set this if you want to pass append arguments to the zdisk/fdimage kernel
  48. FDARGS =
  49. $(obj)/mtools.conf: $(src)/mtools.conf.in
  50. sed -e 's|@OBJ@|$(obj)|g' < $< > $@
  51. # This requires write access to /dev/fd0
  52. zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
  53. MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
  54. syslinux /dev/fd0 ; sync
  55. echo 'default linux $(FDARGS)' | \
  56. MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg
  57. MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync
  58. # These require being root or having syslinux 2.02 or higher installed
  59. fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
  60. dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
  61. MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
  62. syslinux $(obj)/fdimage ; sync
  63. echo 'default linux $(FDARGS)' | \
  64. MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
  65. MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync
  66. fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
  67. dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
  68. MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
  69. syslinux $(obj)/fdimage ; sync
  70. echo 'default linux $(FDARGS)' | \
  71. MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
  72. MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync
  73. zlilo: $(BOOTIMAGE)
  74. if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
  75. if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
  76. cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
  77. cp System.map $(INSTALL_PATH)/
  78. if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
  79. install: $(BOOTIMAGE)
  80. sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"