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 | |
| 7 | GZIP = gzip |
| 8 | GZIP_FLAGS = -v9fc |
| 9 | |
| 10 | ifeq ($(BIG_ENDIAN),1) |
| 11 | OBJCOPY_ARGS := -O elf32-xtensa-be |
| 12 | else |
| 13 | OBJCOPY_ARGS := -O elf32-xtensa-le |
| 14 | endif |
| 15 | |
| 16 | export OBJCOPY_ARGS |
Chris Zankel | 36dffad | 2008-02-12 13:14:17 -0800 | [diff] [blame] | 17 | export CPPFLAGS_boot.lds += -P -C |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 18 | |
| 19 | boot-y := bootstrap.o |
| 20 | |
| 21 | OBJS := $(addprefix $(obj)/,$(boot-y)) |
| 22 | |
Chris Zankel | 36dffad | 2008-02-12 13:14:17 -0800 | [diff] [blame] | 23 | Image: vmlinux $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds |
Bob Wilson | bdd362f | 2008-02-01 16:56:32 -0800 | [diff] [blame] | 24 | $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 25 | 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 Zankel | 36dffad | 2008-02-12 13:14:17 -0800 | [diff] [blame] | 31 | -T arch/$(ARCH)/boot/boot-elf/boot.lds \ |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 32 | -o arch/$(ARCH)/boot/$@.elf $@.tmp |
| 33 | rm -f $@.tmp vmlinux.tmp |
| 34 | |
| 35 | Image.initrd: vmlinux $(OBJS) |
Bob Wilson | bdd362f | 2008-02-01 16:56:32 -0800 | [diff] [blame] | 36 | $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 37 | --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 Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 45 | -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \ |
Chris Zankel | 4bedea9 | 2005-06-23 22:01:12 -0700 | [diff] [blame] | 46 | -o arch/$(ARCH)/boot/$@.elf $@.tmp |
| 47 | rm -f $@.tmp vmlinux.tmp |
| 48 | |
| 49 | |
| 50 | zImage: Image |
| 51 | |
| 52 | zImage.initrd: Image.initrd |
| 53 | |