Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #
  2. # Copyright (C) 2007-2008 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. ifneq ($(CONFIG_AVR32_UBOOT),)
  10. define Build/Clean
  11. $(MAKE) -C u-boot clean
  12. endef
  13. define Build/Compile
  14. $(MAKE) -C u-boot compile
  15. endef
  16. endif
  17. define Image/Prepare
  18. cp $(LINUX_DIR)/arch/avr32/boot/images/uImage $(KDIR)/uImage
  19. endef
  20. define Image/BuildKernel
  21. cp $(KDIR)/uImage $(BIN_DIR)/openwrt-$(BOARD)-uImage
  22. $(STAGING_DIR_HOST)/bin/lzma e $(LINUX_DIR)/arch/avr32/boot/images/vmlinux.bin $(KDIR)/vmlinux.lzma
  23. mkimage -A avr32 -O linux -T kernel -a 0x10000000 -C lzma \
  24. -e 0x90000000 \
  25. -n 'OpenWrt Linux-$(LINUX_VERSION)' \
  26. -d $(KDIR)/vmlinux.lzma $(KDIR)/uImage-lzma
  27. cp $(KDIR)/uImage-lzma $(BIN_DIR)/openwrt-$(BOARD)-uImage-lzma
  28. endef
  29. define Image/Build
  30. $(call Image/Build/$(1),$(1))
  31. endef
  32. define Image/Build/squashfs
  33. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  34. ( \
  35. dd if=$(KDIR)/uImage bs=1024k conv=sync; \
  36. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  37. ) > $(BIN_DIR)/openwrt-$(BOARD)-$(1).img
  38. endef
  39. define Image/Build/jffs2-64k
  40. ( \
  41. dd if=$(KDIR)/uImage bs=1024k conv=sync; \
  42. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  43. ) > $(BIN_DIR)/openwrt-$(BOARD)-$(1).img
  44. endef
  45. $(eval $(call BuildImage))