Makefile 1023 B

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