blob: 25a78c6b153002b9a5486a4cd3a4628b217b2f81 [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
9ifeq ($(BIG_ENDIAN),1)
10OBJCOPY_ARGS := -O elf32-xtensa-be
11else
12OBJCOPY_ARGS := -O elf32-xtensa-le
13endif
14
Chris Zankele7d163f2005-06-30 02:58:59 -070015LD_ARGS = -T $(srctree)/$(obj)/boot.ld
Chris Zankel4bedea92005-06-23 22:01:12 -070016
17boot-y := bootstrap.o
18
19OBJS := $(addprefix $(obj)/,$(boot-y))
Chris Zankele7d163f2005-06-30 02:58:59 -070020LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
Chris Zankel4bedea92005-06-23 22:01:12 -070021
Sam Ravnborga0f97e02007-10-14 22:21:35 +020022LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
Chris Zankel4bedea92005-06-23 22:01:12 -070023
Max Filippov7c94fe42012-09-17 05:44:49 +040024vmlinux.tmp: vmlinux
Bob Wilsonbdd362f2008-02-01 16:56:32 -080025 $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
Max Filippov7c94fe42012-09-17 05:44:49 +040026 $^ $@
27
28vmlinux.tmp.gz: vmlinux.tmp
29 $(GZIP) $(GZIP_FLAGS) $^ > $@
30
31zImage: vmlinux.tmp.gz $(OBJS) $(LIBS)
Chris Zankel4bedea92005-06-23 22:01:12 -070032 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
33 --add-section image=vmlinux.tmp.gz \
34 --set-section-flags image=contents,alloc,load,load,data \
35 $(OBJS) $@.tmp
36 $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
Chris Zankele7d163f2005-06-30 02:58:59 -070037 $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot