Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # Copyright (C) 2007-2010 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/BuildKernel
  18. cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
  19. $(STAGING_DIR_HOST)/bin/lzma e $(LINUX_DIR)/arch/avr32/boot/images/vmlinux.bin $(KDIR)/vmlinux.lzma
  20. mkimage -A avr32 -O linux -T kernel -a 0x10000000 -C lzma \
  21. -e 0x90000000 \
  22. -n 'OpenWrt Linux-$(LINUX_VERSION)' \
  23. -d $(KDIR)/vmlinux.lzma $(KDIR)/uImage-lzma
  24. cp $(KDIR)/uImage-lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma
  25. endef
  26. define Image/Build
  27. $(call Image/Build/$(1),$(1))
  28. endef
  29. define Image/Build/squashfs
  30. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  31. ( \
  32. dd if=$(KDIR)/uImage-lzma bs=1024k conv=sync; \
  33. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  34. ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
  35. endef
  36. define Image/Build/jffs2-64k
  37. ( \
  38. dd if=$(KDIR)/uImage-lzma bs=1024k conv=sync; \
  39. dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
  40. ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
  41. endef
  42. $(eval $(call BuildImage))