2607ed9eb3bce0bbe75d60d7ad1c2c5f21e1d455
[openwrt.git] / target / linux / image / au1000 / Makefile
1 include ../image.mk
2
3 LOADADDR = 0x8108c8f4           # RAM start + 16M 
4 KERNEL_ENTRY = 0x80100000       # Default kernel entry in arch/mips/Makefile
5 RAMSIZE = 0x04000000            # 64MB
6
7 LOADER_MAKEOPTS= \
8                 KDIR=$(KDIR) \
9                 LOADADDR=$(LOADADDR) \
10                 KERNEL_ENTRY=$(KERNEL_ENTRY) \
11                 RAMSIZE=$(RAMSIZE)
12
13 define Build/Clean
14         $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean
15 endef
16
17 define Image/Prepare
18         cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
19         $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) compile
20 endef
21
22 define Image/Build
23         $(TARGET_CROSS)objcopy -O srec -I binary --adjust-vma 0xbe000000 $(KDIR)/root.$(1) $(KDIR)/root.srec
24         grep -v S7 $(KDIR)/root.srec > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
25         grep -v S0 $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec >> $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
26 endef
27
28 $(eval $(call BuildImage))