make aruba lzma loader more generic and move it to target/linux/image/generic/lzma...
[openwrt.git] / openwrt / target / linux / image / generic / lzma-loader / src / Makefile
1 LOADADDR = 0x80400000 # RAM start + 4M
2 KERNEL_ENTRY = 0x80001000
3 RAMSIZE = 0x00100000 # 1MB
4
5 CROSS_COMPILE = mips-linux-
6
7 .S.s:
8 $(CPP) $(CFLAGS) $< -o $*.s
9 .S.o:
10 $(CC) $(CFLAGS) -c $< -o $*.o
11 .c.o:
12 $(CC) $(CFLAGS) -c $< -o $*.o
13
14 CC = $(CROSS_COMPILE)gcc
15 LD = $(CROSS_COMPILE)ld
16 OBJCOPY = $(CROSS_COMPILE)objcopy
17 OBJDUMP = $(CROSS_COMPILE)objdump
18
19 CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE} -DKERNEL_ENTRY=${KERNEL_ENTRY} -D_LZMA_IN_CB
20 # CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE}
21
22 O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
23
24 # Drop some uninteresting sections in the kernel.
25 # This is only relevant for ELF kernels but doesn't hurt a.out
26 drop-sections = .reginfo .mdebug .comment
27 strip-flags = $(addprefix --remove-section=,$(drop-sections))
28
29
30 all : lzma.elf
31
32 lzma.lds: lzma.lds.in
33 sed -e 's,@LOADADDR@,$(LOADADDR),g' $< >$@
34
35 kernel.o: vmlinux.lzma lzma.lds
36 $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $<
37
38 lzma.elf: start.o decompress.o LzmaDecode.o kernel.o
39 $(LD) -s -Tlzma.lds -o $@ $^
40
41 clean:
42 rm -f *.o lzma.elf
This page took 0.040707 seconds and 5 git commands to generate.