Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #
  2. # linux/arch/arm/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinuz image from the original vmlinux
  5. #
  6. AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
  7. HEAD = head.o
  8. OBJS = misc.o decompress.o
  9. FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
  10. #
  11. # Architecture dependencies
  12. #
  13. ifeq ($(CONFIG_ARCH_ACORN),y)
  14. OBJS += ll_char_wr.o font.o
  15. endif
  16. ifeq ($(CONFIG_ARCH_SHARK),y)
  17. OBJS += head-shark.o ofw-shark.o
  18. endif
  19. ifeq ($(CONFIG_ARCH_P720T),y)
  20. # Borrow this code from SA1100
  21. OBJS += head-sa1100.o
  22. endif
  23. ifeq ($(CONFIG_ARCH_SA1100),y)
  24. OBJS += head-sa1100.o
  25. endif
  26. ifeq ($(CONFIG_CPU_XSCALE),y)
  27. OBJS += head-xscale.o
  28. endif
  29. ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
  30. OBJS += head-sharpsl.o
  31. endif
  32. ifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
  33. ifeq ($(CONFIG_CPU_CP15),y)
  34. OBJS += big-endian.o
  35. else
  36. # The endian should be set by h/w design.
  37. endif
  38. endif
  39. #
  40. # We now have a PIC decompressor implementation. Decompressors running
  41. # from RAM should not define ZTEXTADDR. Decompressors running directly
  42. # from ROM or Flash must define ZTEXTADDR (preferably via the config)
  43. # FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
  44. ifeq ($(CONFIG_ZBOOT_ROM),y)
  45. ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT)
  46. ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
  47. else
  48. ZTEXTADDR := 0
  49. ZBSSADDR := ALIGN(4)
  50. endif
  51. SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
  52. suffix_$(CONFIG_KERNEL_GZIP) = gzip
  53. suffix_$(CONFIG_KERNEL_LZO) = lzo
  54. suffix_$(CONFIG_KERNEL_LZMA) = lzma
  55. targets := vmlinux vmlinux.lds \
  56. piggy.$(suffix_y) piggy.$(suffix_y).o \
  57. font.o font.c head.o misc.o $(OBJS)
  58. # Make sure files are removed during clean
  59. extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
  60. ifeq ($(CONFIG_FUNCTION_TRACER),y)
  61. ORIG_CFLAGS := $(KBUILD_CFLAGS)
  62. KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
  63. endif
  64. EXTRA_CFLAGS := -fpic -fno-builtin
  65. EXTRA_AFLAGS := -Wa,-march=all
  66. # Supply ZRELADDR to the decompressor via a linker symbol.
  67. ifneq ($(CONFIG_AUTO_ZRELADDR),y)
  68. LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
  69. endif
  70. ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
  71. LDFLAGS_vmlinux += --be8
  72. endif
  73. # ?
  74. LDFLAGS_vmlinux += -p
  75. # Report unresolved symbol references
  76. LDFLAGS_vmlinux += --no-undefined
  77. # Delete all temporary local symbols
  78. LDFLAGS_vmlinux += -X
  79. # Next argument is a linker script
  80. LDFLAGS_vmlinux += -T
  81. # For __aeabi_uidivmod
  82. lib1funcs = $(obj)/lib1funcs.o
  83. $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
  84. $(call cmd,shipped)
  85. $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
  86. $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
  87. $(call if_changed,ld)
  88. @:
  89. $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
  90. $(call if_changed,$(suffix_y))
  91. $(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE
  92. CFLAGS_font.o := -Dstatic=
  93. $(obj)/font.c: $(FONTC)
  94. $(call cmd,shipped)
  95. $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
  96. @sed "$(SEDFLAGS)" < $< > $@