Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. # This file is subject to the terms and conditions of the GNU General Public
  3. # License. See the file "COPYING" in the main directory of this archive
  4. # for more details.
  5. #
  6. # Copyright (C) 1995, 1998, 2001, 2002 by Ralf Baechle
  7. # Copyright (C) 2004 Maciej W. Rozycki
  8. #
  9. #
  10. # Some DECstations need all possible sections of an ECOFF executable
  11. #
  12. ifdef CONFIG_MACH_DECSTATION
  13. e2eflag := -a
  14. endif
  15. #
  16. # Drop some uninteresting sections in the kernel.
  17. # This is only relevant for ELF kernels but doesn't hurt a.out
  18. #
  19. drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options
  20. strip-flags := $(addprefix --remove-section=,$(drop-sections))
  21. hostprogs-y := elf2ecoff
  22. suffix-y := bin
  23. suffix-$(CONFIG_KERNEL_BZIP2) := bz2
  24. suffix-$(CONFIG_KERNEL_GZIP) := gz
  25. suffix-$(CONFIG_KERNEL_LZMA) := lzma
  26. suffix-$(CONFIG_KERNEL_LZO) := lzo
  27. targets := vmlinux.ecoff
  28. quiet_cmd_ecoff = ECOFF $@
  29. cmd_ecoff = $(obj)/elf2ecoff $(VMLINUX) $@ $(e2eflag)
  30. $(obj)/vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) FORCE
  31. $(call if_changed,ecoff)
  32. targets += vmlinux.bin
  33. quiet_cmd_bin = OBJCOPY $@
  34. cmd_bin = $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $@
  35. $(obj)/vmlinux.bin: $(VMLINUX) FORCE
  36. $(call if_changed,bin)
  37. targets += vmlinux.srec
  38. quiet_cmd_srec = OBJCOPY $@
  39. cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $@
  40. $(obj)/vmlinux.srec: $(VMLINUX) FORCE
  41. $(call if_changed,srec)
  42. UIMAGE_LOADADDR = $(VMLINUX_LOAD_ADDRESS)
  43. UIMAGE_ENTRYADDR = $(VMLINUX_ENTRY_ADDRESS)
  44. #
  45. # Compressed vmlinux images
  46. #
  47. extra-y += vmlinux.bin.bz2
  48. extra-y += vmlinux.bin.gz
  49. extra-y += vmlinux.bin.lzma
  50. extra-y += vmlinux.bin.lzo
  51. $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
  52. $(call if_changed,bzip2)
  53. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  54. $(call if_changed,gzip)
  55. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  56. $(call if_changed,lzma)
  57. $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
  58. $(call if_changed,lzo)
  59. #
  60. # Compressed u-boot images
  61. #
  62. targets += uImage
  63. targets += uImage.bin
  64. targets += uImage.bz2
  65. targets += uImage.gz
  66. targets += uImage.lzma
  67. targets += uImage.lzo
  68. $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
  69. $(call if_changed,uimage,none)
  70. $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE
  71. $(call if_changed,uimage,bzip2)
  72. $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
  73. $(call if_changed,uimage,gzip)
  74. $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
  75. $(call if_changed,uimage,lzma)
  76. $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE
  77. $(call if_changed,uimage,lzo)
  78. $(obj)/uImage: $(obj)/uImage.$(suffix-y)
  79. @ln -sf $(notdir $<) $@
  80. @echo ' Image $@ is ready'