blob: 1fe01b78c1247d40ebf96de4bf05c60a9c988e2a [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
Chris Zankel4bedea92005-06-23 22:01:12 -07007ifeq ($(BIG_ENDIAN),1)
8OBJCOPY_ARGS := -O elf32-xtensa-be
9else
10OBJCOPY_ARGS := -O elf32-xtensa-le
11endif
12
13export OBJCOPY_ARGS
Chris Zankel36dffad2008-02-12 13:14:17 -080014export CPPFLAGS_boot.lds += -P -C
Chris Zankel4bedea92005-06-23 22:01:12 -070015
16boot-y := bootstrap.o
17
18OBJS := $(addprefix $(obj)/,$(boot-y))
19
Max Filippov3f5ec292012-11-05 09:10:00 +040020$(obj)/Image.o: vmlinux.bin $(OBJS)
21 $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
22 --add-section image=vmlinux.bin \
Chris Zankel4bedea92005-06-23 22:01:12 -070023 --set-section-flags image=contents,alloc,load,load,data \
Max Filippov3f5ec292012-11-05 09:10:00 +040024 $(OBJS) $@
Chris Zankel4bedea92005-06-23 22:01:12 -070025
Max Filippov3f5ec292012-11-05 09:10:00 +040026$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
27 $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
28 -T $(obj)/boot.lds \
29 --build-id=none \
30 -o $@ $(obj)/Image.o
31 $(Q)$(kecho) ' Kernel: $@ is ready'
Chris Zankel4bedea92005-06-23 22:01:12 -070032
Max Filippov3f5ec292012-11-05 09:10:00 +040033zImage: $(obj)/../Image.elf