1
0

Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. KERNEL:=$(LINUX_DIR)/vmlinux
  9. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  10. kernel-install:
  11. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) \
  12. $(TARGET_DIR)/boot/kernel
  13. ifeq ($(ADK_TARGET_FS),nfsroot)
  14. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSUSERTARBALL)
  15. @cp $(TARGET_DIR)/boot/kernel $(BIN_DIR)/$(TARGET_KERNEL)
  16. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  17. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSUSERTARBALL}'
  18. endif
  19. ifeq ($(ADK_TARGET_FS),yaffs)
  20. imageinstall: kernel-install $(BIN_DIR)/$(ROOTFSTARBALL)
  21. @echo 'The root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
  22. @echo 'Format your NAND with Routerboot, boot via NFS and'
  23. @echo 'then install kernel and filesystem via:'
  24. @echo 'adkinstall ${ROOTFSTARBALL}'
  25. endif
  26. ifeq ($(ADK_TARGET_FS),archive)
  27. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  28. @cp $(TARGET_DIR)/boot/kernel $(BIN_DIR)/$(TARGET_KERNEL)
  29. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  30. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  31. @echo "Use following command to create a QEMU Image:"
  32. @echo "sudo ./scripts/create-image.sh -f $(ADK_TARGET_ROOTFS) qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  33. @echo "Start qemu with following options:"
  34. @echo 'qemu-system-mips -nographic -M malta -kernel $(BIN_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
  35. endif
  36. ifeq ($(ADK_TARGET_FS),initramfs)
  37. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  38. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  39. @echo 'The kernel file is: $(BIN_DIR)/${TARGET_KERNEL}'
  40. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  41. @echo 'qemu-system-mips -nographic -M malta -kernel $(BIN_DIR)/$(TARGET_KERNEL) -initrd ${BIN_DIR}/${INITRAMFS}'
  42. endif
  43. ifeq ($(ADK_TARGET_FS),initramfs-piggyback)
  44. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinitramfs
  45. @cp $(KERNEL) $(BIN_DIR)/$(TARGET_KERNEL)
  46. @echo 'The kernel+initramfs file is: $(BIN_DIR)/${TARGET_KERNEL}'
  47. @echo "Start qemu with following command line:"
  48. @echo 'qemu-system-mips -nographic -M malta -kernel $(BIN_DIR)/$(TARGET_KERNEL)'
  49. endif