blob: 08e8814f8c713b720ce4a824263f3efcba07dcc9 [file] [log] [blame]
Chris Zankel4bedea92005-06-23 22:01:12 -07001#
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
7GZIP = gzip
8GZIP_FLAGS = -v9fc
9
10ifeq ($(BIG_ENDIAN),1)
11OBJCOPY_ARGS := -O elf32-xtensa-be
12else
13OBJCOPY_ARGS := -O elf32-xtensa-le
14endif
15
16export OBJCOPY_ARGS
Chris Zankel36dffad2008-02-12 13:14:17 -080017export CPPFLAGS_boot.lds += -P -C
Chris Zankel4bedea92005-06-23 22:01:12 -070018
19boot-y := bootstrap.o
20
21OBJS := $(addprefix $(obj)/,$(boot-y))
22
Chris Zankel36dffad2008-02-12 13:14:17 -080023Image: vmlinux $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds
Bob Wilsonbdd362f2008-02-01 16:56:32 -080024 $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
Chris Zankel4bedea92005-06-23 22:01:12 -070025 vmlinux vmlinux.tmp
26 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
27 --add-section image=vmlinux.tmp \
28 --set-section-flags image=contents,alloc,load,load,data \
29 $(OBJS) $@.tmp
30 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
Chris Zankel36dffad2008-02-12 13:14:17 -080031 -T arch/$(ARCH)/boot/boot-elf/boot.lds \
Chris Zankel4bedea92005-06-23 22:01:12 -070032 -o arch/$(ARCH)/boot/$@.elf $@.tmp
33 rm -f $@.tmp vmlinux.tmp
34
35Image.initrd: vmlinux $(OBJS)
Bob Wilsonbdd362f2008-02-01 16:56:32 -080036 $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
Chris Zankel4bedea92005-06-23 22:01:12 -070037 --add-section .initrd=arch/$(ARCH)/boot/ramdisk \
38 --set-section-flags .initrd=contents,alloc,load,load,data \
39 vmlinux vmlinux.tmp
40 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
41 --add-section image=vmlinux.tmp \
42 --set-section-flags image=contents,alloc,load,load,data \
43 $(OBJS) $@.tmp
44 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
Chris Zankele7d163f2005-06-30 02:58:59 -070045 -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
Chris Zankel4bedea92005-06-23 22:01:12 -070046 -o arch/$(ARCH)/boot/$@.elf $@.tmp
47 rm -f $@.tmp vmlinux.tmp
48
49
50zImage: Image
51
52zImage.initrd: Image.initrd
53