2 RAMSIZE = 0x00100000 # 1MB
4 CROSS_COMPILE = mips-linux-
7 $(CPP) $(CFLAGS) $< -o $*.s
9 $(CC) $(CFLAGS) -c $< -o $*.o
11 $(CC) $(CFLAGS) -c $< -o $*.o
13 CC = $(CROSS_COMPILE)gcc
14 LD = $(CROSS_COMPILE)ld
15 OBJCOPY = $(CROSS_COMPILE)objcopy
16 OBJDUMP = $(CROSS_COMPILE)objdump
18 CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE} -D_LZMA_IN_CB
19 # CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE}
21 O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
23 # Drop some uninteresting sections in the kernel.
24 # This is only relevant for ELF kernels but doesn't hurt a.out
25 drop-sections = .reginfo .mdebug .comment
26 strip-flags = $(addprefix --remove-section=,$(drop-sections))
31 kernel.o: vmlinux.lzma
32 $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $<
34 lzma.elf: start.o decompress.o LzmaDecode.o kernel.o
35 $(LD) -s -Tlzma.lds -o $@ $^