Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 $(ADK_TOPDIR)/rules.mk
  4. include $(ADK_TOPDIR)/mk/kernel-build.mk
  5. include $(ADK_TOPDIR)/mk/image.mk
  6. KERNEL:=$(LINUX_DIR)/vmlinux
  7. OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
  8. QEMU_ARGS:=-nographic
  9. # target helper text
  10. ifeq ($(ADK_TARGET_FS),initramfs)
  11. targethelp:
  12. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  13. @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
  14. ifeq ($(ADK_TARGET_QEMU),y)
  15. @echo "Start qemu with following command line:"
  16. @echo 'qemu-system-or32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
  17. endif
  18. endif
  19. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  20. targethelp:
  21. @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
  22. @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
  23. endif
  24. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  25. targethelp:
  26. @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
  27. ifeq ($(ADK_TARGET_SYSTEM_OR1K_SIM),y)
  28. @echo "Start or1ksim via:"
  29. @echo 'sim -f target/or1k/or1ksim.cfg $(FW_DIR)/${TARGET_KERNEL}'
  30. endif
  31. ifeq ($(ADK_TARGET_QEMU),y)
  32. @echo "Start qemu with following command line:"
  33. @echo 'qemu-system-or32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
  34. endif
  35. endif
  36. kernel-strip:
  37. $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
  38. kernel-install: kernel-strip
  39. @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
  40. # filesystem specific targets
  41. ifeq ($(ADK_TARGET_FS),initramfs)
  42. imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
  43. endif
  44. ifeq ($(ADK_TARGET_FS),initramfsarchive)
  45. imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
  46. endif
  47. ifeq ($(ADK_TARGET_FS),initramfspiggyback)
  48. imageinstall: createinitramfs targethelp
  49. endif