Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # |
| 2 | # linux/arch/arm/boot/compressed/Makefile |
| 3 | # |
| 4 | # create a compressed vmlinuz image from the original vmlinux |
| 5 | # |
| 6 | |
Eric Miao | e69edc79 | 2010-07-05 15:56:50 +0200 | [diff] [blame] | 7 | AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | HEAD = head.o |
Russell King | 5de813b | 2010-02-25 12:14:40 +0000 | [diff] [blame] | 9 | OBJS = misc.o decompress.o |
Russell King | 4486b86 | 2007-06-03 18:54:42 +0100 | [diff] [blame] | 10 | FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | # |
| 13 | # Architecture dependencies |
| 14 | # |
| 15 | ifeq ($(CONFIG_ARCH_ACORN),y) |
Russell King | 4486b86 | 2007-06-03 18:54:42 +0100 | [diff] [blame] | 16 | OBJS += ll_char_wr.o font.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | endif |
| 18 | |
| 19 | ifeq ($(CONFIG_ARCH_SHARK),y) |
| 20 | OBJS += head-shark.o ofw-shark.o |
| 21 | endif |
| 22 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | ifeq ($(CONFIG_ARCH_P720T),y) |
| 24 | # Borrow this code from SA1100 |
| 25 | OBJS += head-sa1100.o |
| 26 | endif |
| 27 | |
| 28 | ifeq ($(CONFIG_ARCH_SA1100),y) |
| 29 | OBJS += head-sa1100.o |
| 30 | endif |
| 31 | |
Alexey Charkov | 21f47fb | 2010-12-23 13:11:21 +0100 | [diff] [blame^] | 32 | ifeq ($(CONFIG_ARCH_VT8500),y) |
| 33 | OBJS += head-vt8500.o |
| 34 | endif |
| 35 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | ifeq ($(CONFIG_CPU_XSCALE),y) |
| 37 | OBJS += head-xscale.o |
| 38 | endif |
| 39 | |
Eric Miao | 9c3fca2 | 2010-06-23 09:27:32 +0800 | [diff] [blame] | 40 | ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | OBJS += head-sharpsl.o |
| 42 | endif |
| 43 | |
Catalin Marinas | 2658485 | 2009-05-30 14:00:18 +0100 | [diff] [blame] | 44 | ifeq ($(CONFIG_CPU_ENDIAN_BE32),y) |
Hyok S. Choi | f12d0d7 | 2006-09-26 17:36:37 +0900 | [diff] [blame] | 45 | ifeq ($(CONFIG_CPU_CP15),y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | OBJS += big-endian.o |
Hyok S. Choi | f12d0d7 | 2006-09-26 17:36:37 +0900 | [diff] [blame] | 47 | else |
| 48 | # The endian should be set by h/w design. |
| 49 | endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | endif |
| 51 | |
Kuninori Morimoto | 9a4af11 | 2010-12-01 07:45:00 +0100 | [diff] [blame] | 52 | ifeq ($(CONFIG_ARCH_SHMOBILE),y) |
| 53 | OBJS += head-shmobile.o |
| 54 | endif |
| 55 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | # |
| 57 | # We now have a PIC decompressor implementation. Decompressors running |
| 58 | # from RAM should not define ZTEXTADDR. Decompressors running directly |
| 59 | # from ROM or Flash must define ZTEXTADDR (preferably via the config) |
| 60 | # FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK |
| 61 | ifeq ($(CONFIG_ZBOOT_ROM),y) |
| 62 | ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT) |
| 63 | ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) |
| 64 | else |
| 65 | ZTEXTADDR := 0 |
| 66 | ZBSSADDR := ALIGN(4) |
| 67 | endif |
| 68 | |
| 69 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ |
| 70 | |
Albin Tonnerre | e7db7b4 | 2010-01-08 14:42:43 -0800 | [diff] [blame] | 71 | suffix_$(CONFIG_KERNEL_GZIP) = gzip |
| 72 | suffix_$(CONFIG_KERNEL_LZO) = lzo |
Albin Tonnerre | 6e8699f | 2010-04-03 11:40:28 +0100 | [diff] [blame] | 73 | suffix_$(CONFIG_KERNEL_LZMA) = lzma |
Albin Tonnerre | e7db7b4 | 2010-01-08 14:42:43 -0800 | [diff] [blame] | 74 | |
| 75 | targets := vmlinux vmlinux.lds \ |
| 76 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
| 77 | font.o font.c head.o misc.o $(OBJS) |
Abhishek Sagar | 014c257 | 2008-05-31 14:23:50 +0530 | [diff] [blame] | 78 | |
Magnus Damm | f1b957d | 2010-07-28 05:46:21 +0100 | [diff] [blame] | 79 | # Make sure files are removed during clean |
| 80 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S |
| 81 | |
Steven Rostedt | 606576c | 2008-10-06 19:06:12 -0400 | [diff] [blame] | 82 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
Abhishek Sagar | 014c257 | 2008-05-31 14:23:50 +0530 | [diff] [blame] | 83 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
| 84 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
| 85 | endif |
| 86 | |
Catalin Marinas | 48da78b | 2007-07-11 11:29:28 +0100 | [diff] [blame] | 87 | EXTRA_CFLAGS := -fpic -fno-builtin |
Russell King | 80cec14 | 2008-09-09 13:56:45 +0100 | [diff] [blame] | 88 | EXTRA_AFLAGS := -Wa,-march=all |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 90 | # Supply ZRELADDR to the decompressor via a linker symbol. |
| 91 | ifneq ($(CONFIG_AUTO_ZRELADDR),y) |
| 92 | LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR) |
| 93 | endif |
Catalin Marinas | 2658485 | 2009-05-30 14:00:18 +0100 | [diff] [blame] | 94 | ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) |
| 95 | LDFLAGS_vmlinux += --be8 |
| 96 | endif |
Albin Tonnerre | e7db7b4 | 2010-01-08 14:42:43 -0800 | [diff] [blame] | 97 | # ? |
| 98 | LDFLAGS_vmlinux += -p |
| 99 | # Report unresolved symbol references |
| 100 | LDFLAGS_vmlinux += --no-undefined |
| 101 | # Delete all temporary local symbols |
| 102 | LDFLAGS_vmlinux += -X |
| 103 | # Next argument is a linker script |
| 104 | LDFLAGS_vmlinux += -T |
| 105 | |
| 106 | # For __aeabi_uidivmod |
| 107 | lib1funcs = $(obj)/lib1funcs.o |
| 108 | |
| 109 | $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE |
| 110 | $(call cmd,shipped) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | |
Albin Tonnerre | e7db7b4 | 2010-01-08 14:42:43 -0800 | [diff] [blame] | 112 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ |
| 113 | $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | $(call if_changed,ld) |
| 115 | @: |
| 116 | |
Albin Tonnerre | e7db7b4 | 2010-01-08 14:42:43 -0800 | [diff] [blame] | 117 | $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE |
| 118 | $(call if_changed,$(suffix_y)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | |
Albin Tonnerre | e7db7b4 | 2010-01-08 14:42:43 -0800 | [diff] [blame] | 120 | $(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | |
Russell King | 4486b86 | 2007-06-03 18:54:42 +0100 | [diff] [blame] | 122 | CFLAGS_font.o := -Dstatic= |
| 123 | |
| 124 | $(obj)/font.c: $(FONTC) |
| 125 | $(call cmd,shipped) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | |
Russell King | d93c333 | 2010-09-19 16:16:58 +0100 | [diff] [blame] | 127 | $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | @sed "$(SEDFLAGS)" < $< > $@ |