Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. LOADADDR = 0x8108c8f4 # RAM start + 16M
  10. KERNEL_ENTRY = 0x80100000 # Default kernel entry in arch/mips/Makefile
  11. RAMSIZE = 0x01000000 # 64MB
  12. LOADER_MAKEOPTS= \
  13. KDIR=$(KDIR) \
  14. LOADADDR=$(LOADADDR) \
  15. KERNEL_ENTRY=$(KERNEL_ENTRY) \
  16. RAMSIZE=$(RAMSIZE)
  17. define trxalign/jffs2-128k
  18. -a 0x20000
  19. endef
  20. define trxalign/jffs2-64k
  21. -a 0x10000
  22. endef
  23. define trxalign/squashfs
  24. -a 1024
  25. endef
  26. define Build/Clean
  27. $(MAKE) -C lzma-loader clean
  28. endef
  29. define Image/Prepare
  30. cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
  31. rm -f $(KDIR)/loader.gz
  32. $(MAKE) -C lzma-loader \
  33. BUILD_DIR="$(KDIR)" \
  34. TARGET="$(KDIR)" \
  35. clean install
  36. echo -ne "\\x00" >> $(KDIR)/loader.gz
  37. endef
  38. define Image/Build
  39. $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(1).trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1)
  40. endef
  41. $(eval $(call BuildImage))