Makefile 3.0 KB

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