Makefile 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/mk/kernel.mk
  5. include $(TOPDIR)/mk/modules.mk
  6. include $(TOPDIR)/mk/kernel-build.mk
  7. include $(TOPDIR)/mk/image.mk
  8. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  9. KERNEL:=$(LINUX_DIR)/vmlinuz
  10. else
  11. KERNEL:=$(LINUX_DIR)/vmlinux
  12. endif
  13. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  14. kernel-install:
  15. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) \
  16. $(TARGET_DIR)/boot/kernel
  17. ifeq ($(ADK_TARGET_FS),nfsroot)
  18. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSUSERTARBALL)
  19. @cp $(TARGET_DIR)/boot/kernel $(BIN_DIR)/$(TARGET_KERNEL)
  20. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  21. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSUSERTARBALL}'
  22. endif
  23. ifeq ($(ADK_TARGET_FS),yaffs)
  24. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSTARBALL)
  25. @echo 'The root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
  26. @echo 'Format your NAND with Routerboot, boot via NFS and'
  27. @echo 'then install kernel and filesystem via:'
  28. @echo 'adkinstall ${ROOTFSTARBALL}'
  29. endif
  30. ifeq ($(ADK_TARGET_FS),archive)
  31. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  32. @cp $(TARGET_DIR)/boot/kernel $(BIN_DIR)/$(TARGET_KERNEL)
  33. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  34. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  35. @echo "Use following command to create a QEMU Image:"
  36. @echo "sudo ./scripts/create-image.sh -f $(ADK_TARGET_ROOTFS) qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  37. @echo "Start qemu with following options:"
  38. @echo 'qemu-system-mips -nographic -M malta -kernel $(BIN_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
  39. endif
  40. ifeq ($(ADK_TARGET_FS),initramfs)
  41. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  42. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  43. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  44. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  45. @echo 'qemu-system-mips -nographic -M malta -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}'
  46. endif
  47. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  48. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinitramfs
  49. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  50. @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}'
  51. @echo "Start qemu with following command line:"
  52. @echo 'qemu-system-mips -nographic -M malta -kernel $(BIN_DIR)/$(TARGET_KERNEL)'
  53. endif
  54. ifeq ($(ADK_TARGET_FS),usb)
  55. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  56. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  57. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  58. @echo "Startup the netbook and type del to enter PMON:"
  59. @echo "PMON> load /dev/fs/ext2@usb0/boot/kernel"
  60. @echo "PMON> g console=tty no_auto_cmd"
  61. endif
  62. endif