0d25f8449742d6b5594031894c9b24c50f7e0e45
[openwrt/staging/mkresin.git] / openwrt / target / image / au1000 / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 LOADADDR = 0x8108c8f4 # RAM start + 16M
11 KERNEL_ENTRY = 0x80100000 # Default kernel entry in arch/mips/Makefile
12 RAMSIZE = 0x04000000 # 64MB
13
14 LOADER_MAKEOPTS= \
15 KDIR=$(KDIR) \
16 LOADADDR=$(LOADADDR) \
17 KERNEL_ENTRY=$(KERNEL_ENTRY) \
18 RAMSIZE=$(RAMSIZE)
19
20 define Build/Clean
21 $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean
22 endef
23
24 define Image/Prepare
25 cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
26 $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) compile
27 endef
28
29 define Image/Build
30 $(TARGET_CROSS)objcopy -O srec -I binary --adjust-vma 0xbe000000 $(KDIR)/root.$(1) $(KDIR)/root.srec
31 grep -v S7 $(KDIR)/root.srec > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
32 grep -v S0 $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec >> $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
33 endef
34
35 $(eval $(call BuildImage))