platform.mk 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # List of all the template platform files.
  2. ifeq ($(USE_SMART_BUILD),yes)
  3. # Configuration files directory
  4. ifeq ($(CONFDIR),)
  5. CONFDIR = .
  6. endif
  7. HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h | egrep -e "\#define"))
  8. PLATFORMSRC := ${CHIBIOS}/os/hal/templates/hal_lld.c \
  9. ${CHIBIOS}/os/hal/templates/hal_st_lld.c
  10. ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),)
  11. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_adc_lld.c
  12. endif
  13. ifneq ($(findstring HAL_USE_CAN TRUE,$(HALCONF)),)
  14. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_can_lld.c
  15. endif
  16. ifneq ($(findstring HAL_USE_CRY TRUE,$(HALCONF)),)
  17. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_crypto_lld.c
  18. endif
  19. ifneq ($(findstring HAL_USE_DAC TRUE,$(HALCONF)),)
  20. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_dac_lld.c
  21. endif
  22. ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),)
  23. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_gpt_lld.c
  24. endif
  25. ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),)
  26. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_i2c_lld.c
  27. endif
  28. ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),)
  29. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_i2s_lld.c
  30. endif
  31. ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),)
  32. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_icu_lld.c
  33. endif
  34. ifneq ($(findstring HAL_USE_MAC TRUE,$(HALCONF)),)
  35. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_mac_lld.c
  36. endif
  37. ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),)
  38. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_pal_lld.c
  39. endif
  40. ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),)
  41. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_pwm_lld.c
  42. endif
  43. ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),)
  44. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_rtc_lld.c
  45. endif
  46. ifneq ($(findstring HAL_USE_SDC TRUE,$(HALCONF)),)
  47. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_sdc_lld.c
  48. endif
  49. ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),)
  50. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_serial_lld.c
  51. endif
  52. ifneq ($(findstring HAL_USE_SIO TRUE,$(HALCONF)),)
  53. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_sio_lld.c
  54. endif
  55. ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),)
  56. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_spi_lld.c
  57. endif
  58. ifneq ($(findstring HAL_USE_TRNG TRUE,$(HALCONF)),)
  59. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_trng_lld.c
  60. endif
  61. ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),)
  62. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_uart_lld.c
  63. endif
  64. ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),)
  65. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_usb_lld.c
  66. endif
  67. ifneq ($(findstring HAL_USE_WDG TRUE,$(HALCONF)),)
  68. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_wdg_lld.c
  69. endif
  70. ifneq ($(findstring HAL_USE_WSPI TRUE,$(HALCONF)),)
  71. PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_wspi_lld.c
  72. endif
  73. else
  74. PLATFORMSRC = ${CHIBIOS}/os/hal/templates/hal_lld.c \
  75. ${CHIBIOS}/os/hal/templates/hal_adc_lld.c \
  76. ${CHIBIOS}/os/hal/templates/hal_can_lld.c \
  77. ${CHIBIOS}/os/hal/templates/hal_crypto_lld.c \
  78. ${CHIBIOS}/os/hal/templates/hal_dac_lld.c \
  79. ${CHIBIOS}/os/hal/templates/hal_gpt_lld.c \
  80. ${CHIBIOS}/os/hal/templates/hal_i2c_lld.c \
  81. ${CHIBIOS}/os/hal/templates/hal_i2s_lld.c \
  82. ${CHIBIOS}/os/hal/templates/hal_icu_lld.c \
  83. ${CHIBIOS}/os/hal/templates/hal_mac_lld.c \
  84. ${CHIBIOS}/os/hal/templates/hal_pal_lld.c \
  85. ${CHIBIOS}/os/hal/templates/hal_pwm_lld.c \
  86. ${CHIBIOS}/os/hal/templates/hal_rtc_lld.c \
  87. ${CHIBIOS}/os/hal/templates/hal_sdc_lld.c \
  88. ${CHIBIOS}/os/hal/templates/hal_serial_lld.c \
  89. ${CHIBIOS}/os/hal/templates/hal_sio_lld.c \
  90. ${CHIBIOS}/os/hal/templates/hal_spi_lld.c \
  91. ${CHIBIOS}/os/hal/templates/hal_st_lld.c \
  92. ${CHIBIOS}/os/hal/templates/hal_trng_lld.c \
  93. ${CHIBIOS}/os/hal/templates/hal_uart_lld.c \
  94. ${CHIBIOS}/os/hal/templates/hal_usb_lld.c \
  95. ${CHIBIOS}/os/hal/templates/hal_wdg_lld.c \
  96. ${CHIBIOS}/os/hal/templates/hal_wspi_lld.c
  97. endif
  98. # Required include directories
  99. PLATFORMINC = ${CHIBIOS}/os/hal/templates
  100. # Shared variables
  101. ALLCSRC += $(PLATFORMSRC)
  102. ALLINC += $(PLATFORMINC)