Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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
  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_CLPS7500),y)
  22. HEAD = head-clps7500.o
  23. endif
  24. ifeq ($(CONFIG_ARCH_P720T),y)
  25. # Borrow this code from SA1100
  26. OBJS += head-sa1100.o
  27. endif
  28. ifeq ($(CONFIG_ARCH_SA1100),y)
  29. OBJS += head-sa1100.o
  30. endif
  31. ifeq ($(CONFIG_CPU_XSCALE),y)
  32. OBJS += head-xscale.o
  33. endif
  34. ifeq ($(CONFIG_PXA_SHARPSL),y)
  35. OBJS += head-sharpsl.o
  36. endif
  37. ifeq ($(CONFIG_ARCH_AT91RM9200),y)
  38. OBJS += head-at91rm9200.o
  39. endif
  40. ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
  41. ifeq ($(CONFIG_CPU_CP15),y)
  42. OBJS += big-endian.o
  43. else
  44. # The endian should be set by h/w design.
  45. endif
  46. endif
  47. #
  48. # We now have a PIC decompressor implementation. Decompressors running
  49. # from RAM should not define ZTEXTADDR. Decompressors running directly
  50. # from ROM or Flash must define ZTEXTADDR (preferably via the config)
  51. # FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
  52. ifeq ($(CONFIG_ZBOOT_ROM),y)
  53. ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT)
  54. ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
  55. else
  56. ZTEXTADDR := 0
  57. ZBSSADDR := ALIGN(4)
  58. endif
  59. SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
  60. targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
  61. head.o misc.o $(OBJS)
  62. EXTRA_CFLAGS := -fpic -fno-builtin
  63. EXTRA_AFLAGS :=
  64. # Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
  65. # linker symbols. We only define initrd_phys and params_phys if the
  66. # machine class defined the corresponding makefile variable.
  67. LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
  68. ifneq ($(INITRD_PHYS),)
  69. LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
  70. endif
  71. ifneq ($(PARAMS_PHYS),)
  72. LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
  73. endif
  74. LDFLAGS_vmlinux += -p --no-undefined -X \
  75. $(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T
  76. # Don't allow any static data in misc.o, which
  77. # would otherwise mess up our GOT table
  78. CFLAGS_misc.o := -Dstatic=
  79. $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
  80. $(addprefix $(obj)/, $(OBJS)) FORCE
  81. $(call if_changed,ld)
  82. @:
  83. $(obj)/piggy.gz: $(obj)/../Image FORCE
  84. $(call if_changed,gzip)
  85. $(obj)/piggy.o: $(obj)/piggy.gz FORCE
  86. CFLAGS_font.o := -Dstatic=
  87. $(obj)/font.c: $(FONTC)
  88. $(call cmd,shipped)
  89. $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
  90. @sed "$(SEDFLAGS)" < $< > $@
  91. $(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c