Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. SDK_INSTALL_DIR=$(sdkdir)
  2. REPO_DIR=$(sdkdir)/src
  3. SDK_BUILD_DIR=$(SDK_INSTALL_DIR)/work
  4. #SDK_BIN_DIR=$(SDK_INSTALL_DIR)/bin
  5. SDK_ETC_DIR=$(SDK_INSTALL_DIR)/conf
  6. SDK_LOG_DIR=$(SDK_INSTALL_DIR)/logs
  7. SDK_OUTPUT_DIR=$(SDK_INSTALL_DIR)/output
  8. SDK_PREBUILD_DIR=$(SDK_INSTALL_DIR)/prebuild
  9. #SDK_IMAGES_DIR=$(SDK_PREBUILD_DIR)/images
  10. #SDK_TEMPLATES_DIR=$(SDK_INSTALL_DIR)/templates
  11. MK_DIR=$(MAKEFILE_DIR)/staging
  12. MK_ENV_DIR=$(MK_DIR)/env
  13. MK_COMPONENTS_DIR=$(MK_DIR)/components
  14. MK_BOARDS_DIR=$(MK_DIR)/boards
  15. MK_DISTROS_DIR=$(MK_DIR)/distros
  16. KCONDIFLIB_DIR=$(MK_DIR)/Kconfiglib
  17. SDK_STAGING_CONFIGS_DIR=$(SDK_ETC_DIR)/staging
  18. MAIN_CONFIG=$(SDK_STAGING_CONFIGS_DIR)/main.config
  19. ## main config file
  20. -include $(MAIN_CONFIG)
  21. ## make sure we are using bash for "make"
  22. SHELL = /bin/bash
  23. ## RISC-V dev boards
  24. ifeq ($(CONFIG_VISIONFIVE_V1),y)
  25. BOARD_NAME=visionfive_v1
  26. endif
  27. #ifeq ($(CONFIG_VISIONFIVE_Vx),y)
  28. #BOARD_NAME=visionfive_vx
  29. #endif
  30. ## load config file for a specific development board
  31. CONFIG_FILE=$(SDK_STAGING_CONFIGS_DIR)/$(shell echo $(CONFIG_CONFIG_FILE).config)
  32. -include $(CONFIG_FILE)
  33. include $(MK_DIR)/Rlue.mk
  34. include $(MK_DIR)/common.mk
  35. ## Components
  36. #include $(MK_COMPONENTS_DIR)/qemu.mk
  37. #include $(MK_COMPONENTS_DIR)/uefi.mk
  38. include $(MK_COMPONENTS_DIR)/opensbi.mk
  39. include $(MK_COMPONENTS_DIR)/u-boot.mk
  40. #include $(MK_COMPONENTS_DIR)/grub.mk
  41. include $(MK_COMPONENTS_DIR)/linux.mk
  42. #include $(MK_COMPONENTS_DIR)/busybox.mk
  43. include $(MK_COMPONENTS_DIR)/fit.mk
  44. ## distros
  45. #include $(MK_DISTROS_DIR)/minimal.mk
  46. #include $(MK_DISTROS_DIR)/buildroot.mk
  47. #include $(MK_DISTROS_DIR)/openwrt.mk
  48. #include $(MK_DISTROS_DIR)/fedora.mk
  49. main_setup:
  50. export KCONFIG_CONFIG=$(MAIN_CONFIG); \
  51. export MENUCONFIG_STYLE="aquatic selection=fg:red,bg:green"; \
  52. $(KCONDIFLIB_DIR)/menuconfig.py $(MK_DIR)/Kconfig
  53. ifneq ($(BOARD_NAME),"")
  54. include $(MK_BOARDS_DIR)/$(BOARD_NAME)/Makefile
  55. else
  56. $(warning Missing board configuration, please run 'make main_setup' first!)
  57. endif
  58. $(BOARD_NAME)_config:
  59. export KCONFIG_CONFIG=$(CONFIG_FILE); \
  60. $(KCONDIFLIB_DIR)/menuconfig.py $(MK_BOARDS_DIR)/$(BOARD_NAME)/Kconfig
  61. PHONY += FORCE
  62. FORCE:
  63. # Declare the contents of the .PHONY variable as phony. We keep that
  64. # information in a variable so we can use it in if_changed and friends.
  65. .PHONY: $(PHONY)