ramips: check the size of the uImage in image generation
[openwrt.git] / target / linux / adm8668 / image / lzma-loader / src / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 RAMSTART = 0x80000000
8 RAMSIZE = 0x00800000 # 8MB
9 LOADADDR = 0x80400000 # RAM start + 4M
10 KERNEL_ENTRY = 0x80002000
11
12 CROSS_COMPILE = mipsel-openwrt-linux-
13
14 OBJCOPY:= $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S
15 CFLAGS := -I./include -fno-builtin -Os -G 0 -ffunction-sections -mno-abicalls -fno-pic -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -Wall -DRAMSTART=${RAMSTART} -DRAMSIZE=${RAMSIZE} -DKERNEL_ENTRY=${KERNEL_ENTRY}
16
17 .c.o:
18 $(CC) $(CFLAGS) -c $< -o $*.o
19
20 CC = $(CROSS_COMPILE)gcc
21 LD = $(CROSS_COMPILE)ld
22 OBJDUMP = $(CROSS_COMPILE)objdump
23
24 O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
25
26 # Drop some uninteresting sections in the kernel.
27 # This is only relevant for ELF kernels but doesn't hurt a.out
28 drop-sections = .reginfo .mdebug .comment
29 strip-flags = $(addprefix --remove-section=,$(drop-sections))
30
31 all : lzma.elf lzma.bin
32
33 lzma.lds: lzma.lds.in
34 sed -e 's,@LOADADDR@,$(LOADADDR),g' $< >$@
35
36 kernel.o: vmlinux.lzma lzma.lds
37 $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $<
38
39 lzma.bin: lzma.elf
40 $(OBJCOPY) $< $@
41
42 lzma.elf: decompress.o stubs.o LzmaDecode.o kernel.o lzma.lds
43 $(LD) -T lzma.lds -o $@ $^
44 #-s ^
45
46 clean:
47 rm -f *.o lzma.elf lzma.bin *.tmp *.lds
This page took 0.038907 seconds and 5 git commands to generate.