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