Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 1 | # |
| 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 | |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 7 | ifeq ($(BIG_ENDIAN),1) |
| 8 | OBJCOPY_ARGS := -O elf32-xtensa-be |
| 9 | else |
| 10 | OBJCOPY_ARGS := -O elf32-xtensa-le |
| 11 | endif |
| 12 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 13 | LD_ARGS = -T $(srctree)/$(obj)/boot.ld |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 14 | |
| 15 | boot-y := bootstrap.o |
| 16 | |
| 17 | OBJS := $(addprefix $(obj)/,$(boot-y)) |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 18 | LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 19 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 20 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 21 | |
Max Filippov | 3f5ec29 | 2012-11-05 09:10:00 +0400 | [diff] [blame^] | 22 | $(obj)/zImage.o: vmlinux.bin.gz $(OBJS) |
| 23 | $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ |
| 24 | --add-section image=vmlinux.bin.gz \ |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 25 | --set-section-flags image=contents,alloc,load,load,data \ |
Max Filippov | 3f5ec29 | 2012-11-05 09:10:00 +0400 | [diff] [blame^] | 26 | $(OBJS) $@ |
| 27 | |
| 28 | $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS) |
| 29 | $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC) |
| 30 | |
| 31 | $(obj)/../zImage.redboot: $(obj)/zImage.elf |
| 32 | $(Q)$(OBJCOPY) -S -O binary $< $@ |
| 33 | $(Q)$(kecho) ' Kernel: $@ is ready' |
| 34 | |
| 35 | zImage: $(obj)/../zImage.redboot |