1
0

makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. .PHONY: debug boot all clean menuconfig
  2. CC = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)gcc
  3. CXX = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)g++
  4. CPP = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)gcc -E -P -x c
  5. STRIP = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)strip --strip-unneeded
  6. OBJCOPY = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)objcopy
  7. OBJDUMP = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)objdump
  8. LD = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)ld
  9. AR = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)ar rcs
  10. NM = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)nm
  11. OD = $(RTT_EXEC_PATH)/$(RTT_CC_PREFIX)objdump
  12. RTCONFIG =
  13. include .config
  14. ifdef CONFIG_TARGET_E2000Q
  15. RTCONFIG := e2000q
  16. endif
  17. ifdef CONFIG_TARGET_E2000D
  18. RTCONFIG := e2000d
  19. endif
  20. ifdef CONFIG_TARGET_PHYTIUMPI
  21. RTCONFIG := phytium_pi
  22. endif
  23. ifdef CONFIG_RT_USING_SMART
  24. RTCONFIG := $(RTCONFIG)_rtsmart
  25. else
  26. RTCONFIG := $(RTCONFIG)_rtthread
  27. endif
  28. ifdef CONFIG_PHYTIUM_RTT_TEST
  29. RTCONFIG := $(RTCONFIG)_test
  30. endif
  31. boot:
  32. make all
  33. cp rtthread_a64.elf /mnt/d/tftboot
  34. cp rtthread_a64.bin /mnt/d/tftboot
  35. debug:
  36. @$(OD) -D rtthread_a64.elf > rtthread_a64.asm
  37. @$(OD) -S rtthread_a64.elf > rtthread_a64.dis
  38. all:
  39. @echo "Build started..."
  40. scons -j1024
  41. clean:
  42. @echo "Cleaning..."
  43. scons -c
  44. menuconfig:
  45. @echo "Running menuconfig..."
  46. scons --menuconfig
  47. saveconfig:
  48. @echo "Save configs to" ./configs/$(RTCONFIG)
  49. @cp ./.config ./configs/$(RTCONFIG) -f
  50. @cp ./rtconfig.h ./configs/$(RTCONFIG).h -f
  51. load_e2000q_rtsmart:
  52. @echo "Load configs from ./configs/e2000q_rtsmart"
  53. @cp ./configs/e2000q_rtsmart ./.config -f
  54. @cp ./configs/e2000q_rtsmart.h ./rtconfig.h -f
  55. @scons -c
  56. load_e2000q_rtsmart_test:
  57. @echo "Load configs from ./configs/e2000q_rtsmart"
  58. @cp ./configs/e2000q_rtsmart_test ./.config -f
  59. @cp ./configs/e2000q_rtsmart_test.h ./rtconfig.h -f
  60. @scons -c
  61. load_e2000q_rtthread:
  62. @echo "Load configs from ./configs/e2000q_rtthread"
  63. @cp ./configs/e2000q_rtthread ./.config -f
  64. @cp ./configs/e2000q_rtthread.h ./rtconfig.h -f
  65. @scons -c
  66. load_e2000q_rtthread_test:
  67. @echo "Load configs from ./configs/e2000q_rtthread"
  68. @cp ./configs/e2000q_rtthread_test ./.config -f
  69. @cp ./configs/e2000q_rtthread_test.h ./rtconfig.h -f
  70. @scons -c
  71. load_e2000d_rtsmart:
  72. @echo "Load configs from ./configs/e2000d_rtsmart"
  73. @cp ./configs/e2000d_rtsmart ./.config -f
  74. @cp ./configs/e2000d_rtsmart.h ./rtconfig.h -f
  75. @scons -c
  76. load_e2000d_rtsmart_test:
  77. @echo "Load configs from ./configs/e2000d_rtsmart"
  78. @cp ./configs/e2000d_rtsmart_test ./.config -f
  79. @cp ./configs/e2000d_rtsmart_test.h ./rtconfig.h -f
  80. @scons -c
  81. load_e2000d_rtthread:
  82. @echo "Load configs from ./configs/e2000d_rtthread"
  83. @cp ./configs/e2000d_rtthread ./.config -f
  84. @cp ./configs/e2000d_rtthread.h ./rtconfig.h -f
  85. @scons -c
  86. load_e2000d_rtthread_test:
  87. @echo "Load configs from ./configs/e2000d_rtthread"
  88. @cp ./configs/e2000d_rtthread_test ./.config -f
  89. @cp ./configs/e2000d_rtthread_test.h ./rtconfig.h -f
  90. @scons -c
  91. load_phytium_pi_rtthread:
  92. @echo "Load configs from ./configs/phytium_pi_rtthread"
  93. @cp ./configs/phytium_pi_rtthread ./.config -f
  94. @cp ./configs/phytium_pi_rtthread.h ./rtconfig.h -f
  95. scons -c
  96. load_phytium_pi_rtsmart:
  97. @echo "Load configs from ./configs/phytium_pi_rtsmart"
  98. @cp ./configs/phytium_pi_rtsmart ./.config -f
  99. @cp ./configs/phytium_pi_rtsmart.h ./rtconfig.h -f
  100. @scons -c