Makefile.mk 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. include $(BUILD_DIR)/compile/$(CONFIG_CHIP)/common.inc
  2. MONITOR_SOC_NAME=Monitor_SOC
  3. VPATH = $(SDK_MIDDLEWARE_DIR)
  4. INCLUDES = -I$(SDK_BOOT_DIR)/../Driver/Chip/$(CONFIG_CHIP)
  5. INCLUDES += -I$(SDK_BOOT_DIR)/../Driver/Chip/$(CONFIG_CHIP)/regs
  6. INCLUDES += -I$(SDK_VOS_DIR)/inc
  7. INCLUDES += -I$(SDK_VOS_DIR)/risc/inc
  8. INCLUDES += -I$(SDK_VOS_DIR)/freertos/FreeRTOS/Include
  9. INCLUDES += -I$(SDK_VOS_DIR)/freertos/FreeRTOS/Source/include
  10. INCLUDES += -I$(SDK_VOS_DIR)/freertos/FreeRTOS/Source/portable/GCC/RISC32
  11. INCLUDES += -I$(SDK_COMMON_DIR)
  12. INCLUDES += -I$(SDK_COMMON_DIR)/Util/HvQueue/inc
  13. INCLUDES += -I$(SDK_COMMON_DIR)/Util/Utilities/inc
  14. INCLUDES += -I$(SDK_COMMON_DIR)/Event
  15. INCLUDES += -I$(SDK_COMMON_DIR)/Assert
  16. INCLUDES += -I$(SDK_COMMON_DIR)/Timer/inc
  17. INCLUDES += -I$(SDK_COMMON_DIR)/Database/inc
  18. INCLUDES += -I$(SDK_COMMON_DIR)/Debug/LetterShell/inc
  19. INCLUDES += -I$(SDK_DIR)
  20. INCLUDES += -I$(SDK_DIR)/MiddleWare/ChannelManager/inc
  21. INCLUDES += -I$(SDK_DIR)/MiddleWare/PowerManager/inc
  22. INCLUDES += -I$(SDK_DIR)/MiddleWare/InputPortManager/inc
  23. INCLUDES += -I$(SDK_DIR)/MiddleWare/InputPortManager/Ddcci/inc
  24. INCLUDES += -I$(SDK_DIR)/MiddleWare/InputPortManager/DisplayPort/inc
  25. INCLUDES += -I$(SDK_DIR)/MiddleWare/InputPortManager/HDCP/inc
  26. INCLUDES += -I$(SDK_DIR)/MiddleWare/InputPortManager/HDMI/inc
  27. INCLUDES += -I$(SDK_DIR)/MiddleWare/PanelManager/inc
  28. INCLUDES += -I$(SDK_DIR)/MiddleWare/RunTime/SystemTask/inc
  29. INCLUDES += -I$(USER_DIR)/$(CONFIG_VENDOR)/$(CONFIG_PROJECT)/System/EventHub/inc
  30. INCLUDES += -I$(SDK_DIR)/MiddleWare/RunTime/OsdTask/inc
  31. INCLUDES += -I$(SDK_DIR)/MiddleWare/RunTime/UrgentTask/inc
  32. INCLUDES += -I$(SDK_DIR)/MiddleWare/RunTime/UsbTask/inc
  33. INCLUDES += -I$(SDK_DIR)/MiddleWare/RunTime/AmbientLight/inc
  34. INCLUDES += -I$(USER_DIR)/$(CONFIG_VENDOR)/$(CONFIG_PROJECT)/Pq
  35. LINK_SCRIPT_DIR = $(BUILD_DIR)/scripts/ldscript/$(CONFIG_CHIP)
  36. LINK_SCRIPT = $(LINK_SCRIPT_DIR)/$(CONFIG_CHIP).ld
  37. LINK_SCRIPT_DB = $(LINK_SCRIPT_DIR)/$(CONFIG_CHIP)-db.ld
  38. LIB_INCLUDE= -L$(LINK_SCRIPT_DIR)
  39. LIB_STATIC= $(addprefix $(BUILD_OUT_IMG_DIR)/,$(CONFIG_SDK_LIB)) $(addprefix $(BUILD_OUT_IMG_DIR)/,$(CONFIG_USER_LIB)) $(addprefix $(BUILD_OUT_IMG_DIR)/,$(CONFIG_SDK_PREBUILD_LIB)) $(addprefix $(BUILD_OUT_IMG_DIR)/,$(CONFIG_SDK_PREBUILD_NO_LIB))
  40. OBJ_MONITOR_SOC_APP_C = $(wildcard $(SDK_MIDDLEWARE_DIR)/*.c)
  41. OBJ_MONITOR_SOC_APP_C_NODIR = $(notdir $(OBJ_MONITOR_SOC_APP_C))
  42. OBJ_MONITOR_SOC_APP_O = $(OBJ_MONITOR_SOC_APP_C_NODIR:%.c=%.o)
  43. MONITOR_SOC_APP_C_NODIR_O = $(OBJ_MONITOR_SOC_APP_O)
  44. MONITOR_SOC_APP_C_WITH_DIR_O= $(addprefix $(BUILD_OUT_OBJ_DIR)/,$(MONITOR_SOC_APP_C_NODIR_O))
  45. MONITOR_SOC_APP = $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).bin
  46. debug:$(MONITOR_SOC_APP)
  47. release:$(MONITOR_SOC_APP)
  48. gdb:$(MONITOR_SOC_APP)
  49. $(HEADER)$(GDB) $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf -x "$(BUILD_DIR)/scripts/risc.gdbinit" -ex target\ remote\ $(IP) -ex set\ endian\ little -ex mon\ halt
  50. define PRINT_SECTION_INFO
  51. $(HEADER)$(OBJDUMP) -hww $1
  52. endef
  53. $(MONITOR_SOC_APP):$(MONITOR_SOC_APP_C_NODIR_O) $(LIB_STATIC)
  54. $(HEADER)$(CC) $(LIB_INCLUDE) -T$(LINK_SCRIPT) $(LD_FLAG) $(MONITOR_SOC_APP_C_WITH_DIR_O) -o $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf -Wl,-Map=$(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).map -Wl,-start-group $(LIB_STATIC) -lc -lm -lgcc -Wl,-end-group
  55. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf $@
  56. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf --only-section=.boot_text --only-section=.boot_rodata --only-section=.boot_data --only-section=.boot_vector $(BUILD_OUT_IMG_DIR)/ram-$(MONITOR_SOC_NAME).bin
  57. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf --only-section=.text --only-section=.rodata --only-section=.data $(BUILD_OUT_IMG_DIR)/ddr-$(MONITOR_SOC_NAME).bin
  58. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf --only-section=.boot_rom_text --only-section=.boot_text --only-section=.boot_rodata --only-section=.boot_data --only-section=.boot_vector $(BUILD_OUT_IMG_DIR)/silicon_boot.bin
  59. # $(HEADER)$(OBJDUMP) -D -S $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf > $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).S
  60. $(call PRINT_SECTION_INFO,$(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf)
  61. $(HEADER)$(CC) $(LIB_INCLUDE) -T$(LINK_SCRIPT_DB) $(LD_FLAG) $(MONITOR_SOC_APP_C_WITH_DIR_O) -o $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB -Wl,-Map=$(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).map-DB -Wl,-start-group $(LIB_STATIC) -lc -lm -lgcc -Wl,-end-group
  62. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB $@-DB
  63. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB --only-section=.boot_text --only-section=.boot_rodata --only-section=.boot_data --only-section=.boot_vector $(BUILD_OUT_IMG_DIR)/ram-$(MONITOR_SOC_NAME).bin-DB
  64. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB --only-section=.text --only-section=.rodata --only-section=.data $(BUILD_OUT_IMG_DIR)/ddr-$(MONITOR_SOC_NAME).bin-DB
  65. $(HEADER)$(OBJCOPY) -O binary $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB --only-section=.boot_rom_text --only-section=.boot_text --only-section=.boot_rodata --only-section=.boot_data --only-section=.boot_vector $(BUILD_OUT_IMG_DIR)/silicon_boot.bin-DB
  66. # $(HEADER)$(OBJDUMP) -D -S $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB > $(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME)-DB.S
  67. $(call PRINT_SECTION_INFO,$(BUILD_OUT_IMG_DIR)/$(MONITOR_SOC_NAME).elf-DB)