Makefile 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # Copyright (C) 2006-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. JFFS2_BLOCKSIZE=124k
  10. JFFS2OPTS += -n -s 2048
  11. define Image/BuildKernel
  12. $(TARGET_CROSS)objcopy -O binary -R .note -R .comment -S \
  13. $(LINUX_DIR)/arch/arm/boot/compressed/vmlinux $(BIN_DIR)/$(IMG_PREFIX)-kernel.bin
  14. $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS), \
  15. $(CP) $(LINUX_DIR)/usr/initramfs_data.cpio.gz, \
  16. gzip -c < $(LINUX_DIR)/usr/initramfs_data.cpio > \
  17. ) $(BIN_DIR)/$(IMG_PREFIX)-ramdisk.bin
  18. $(CP) ./run-emulator.sh $(BIN_DIR)/
  19. endef
  20. define Image/Build/jffs2-124k
  21. $(CP) ./ubinize.cfg $(KDIR)/
  22. (cd $(KDIR); \
  23. ubinize \
  24. -o $(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
  25. -p 128KiB -m 2KiB -s 2KiB ubinize.cfg; \
  26. )
  27. nand_ecc \
  28. $(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
  29. $(BIN_DIR)/$(IMG_PREFIX)-system.bin
  30. endef
  31. define Image/Build
  32. $(call Image/Build/$(1),$(1))
  33. endef
  34. $(eval $(call BuildImage))