Makefile 879 B

123456789101112131415161718192021222324252627282930313233343536
  1. #
  2. # Copyright (C) 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. define Image/BuildKernel
  10. cp $(KDIR)/$(KERNELNAME) $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
  11. endef
  12. define Image/BuildKernel/Initramfs
  13. cp $(KDIR)/$(KERNELNAME)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs.elf
  14. endef
  15. define Image/Build/squashfs
  16. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  17. endef
  18. define Image/Build
  19. $(call Image/Build/$(1))
  20. $(call Build/sdcard-img)
  21. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  22. endef
  23. define Build/sdcard-img
  24. ./gen_realview_sdcard_img.sh \
  25. $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)sdcard.img \
  26. $(KDIR)/root.ext4 \
  27. $(CONFIG_TARGET_ROOTFS_PARTSIZE)
  28. endef
  29. $(eval $(call BuildImage))