hal.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # List of all the ChibiOS/HAL files, there is no need to remove the files
  2. # from this list, you can disable parts of the HAL by editing halconf.h.
  3. ifeq ($(USE_SMART_BUILD),yes)
  4. # Configuration files directory
  5. ifeq ($(HALCONFDIR),)
  6. ifeq ($(CONFDIR),)
  7. HALCONFDIR = .
  8. else
  9. HALCONFDIR := $(CONFDIR)
  10. endif
  11. endif
  12. HALCONF := $(strip $(shell cat $(HALCONFDIR)/halconf.h | egrep -e "\#define"))
  13. HALSRC := $(CHIBIOS)/os/hal/src/hal.c \
  14. $(CHIBIOS)/os/hal/src/hal_st.c \
  15. $(CHIBIOS)/os/hal/src/hal_buffers.c \
  16. $(CHIBIOS)/os/hal/src/hal_queues.c \
  17. $(CHIBIOS)/os/hal/src/hal_mmcsd.c
  18. ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),)
  19. HALSRC += $(CHIBIOS)/os/hal/src/hal_adc.c
  20. endif
  21. ifneq ($(findstring HAL_USE_CAN TRUE,$(HALCONF)),)
  22. HALSRC += $(CHIBIOS)/os/hal/src/hal_can.c
  23. endif
  24. ifneq ($(findstring HAL_USE_CRY TRUE,$(HALCONF)),)
  25. HALSRC += $(CHIBIOS)/os/hal/src/hal_crypto.c
  26. endif
  27. ifneq ($(findstring HAL_USE_DAC TRUE,$(HALCONF)),)
  28. HALSRC += $(CHIBIOS)/os/hal/src/hal_dac.c
  29. endif
  30. ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),)
  31. HALSRC += $(CHIBIOS)/os/hal/src/hal_gpt.c
  32. endif
  33. ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),)
  34. HALSRC += $(CHIBIOS)/os/hal/src/hal_i2c.c
  35. endif
  36. ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),)
  37. HALSRC += $(CHIBIOS)/os/hal/src/hal_i2s.c
  38. endif
  39. ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),)
  40. HALSRC += $(CHIBIOS)/os/hal/src/hal_icu.c
  41. endif
  42. ifneq ($(findstring HAL_USE_EICU TRUE,$(HALCONF)),)
  43. HALSRC += $(CHIBIOS)/os/hal/src/hal_eicu.c
  44. endif
  45. ifneq ($(findstring HAL_USE_MAC TRUE,$(HALCONF)),)
  46. HALSRC += $(CHIBIOS)/os/hal/src/hal_mac.c
  47. endif
  48. ifneq ($(findstring HAL_USE_MMC_SPI TRUE,$(HALCONF)),)
  49. HALSRC += $(CHIBIOS)/os/hal/src/hal_mmc_spi.c
  50. endif
  51. ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),)
  52. HALSRC += $(CHIBIOS)/os/hal/src/hal_pal.c
  53. endif
  54. ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),)
  55. HALSRC += $(CHIBIOS)/os/hal/src/hal_pwm.c
  56. endif
  57. ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),)
  58. HALSRC += $(CHIBIOS)/os/hal/src/hal_rtc.c
  59. endif
  60. ifneq ($(findstring HAL_USE_SDC TRUE,$(HALCONF)),)
  61. HALSRC += $(CHIBIOS)/os/hal/src/hal_sdc.c
  62. endif
  63. ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),)
  64. HALSRC += $(CHIBIOS)/os/hal/src/hal_serial.c
  65. endif
  66. ifneq ($(findstring HAL_USE_SERIAL_USB TRUE,$(HALCONF)),)
  67. HALSRC += $(CHIBIOS)/os/hal/src/hal_serial_usb.c
  68. endif
  69. ifneq ($(findstring HAL_USE_SIO TRUE,$(HALCONF)),)
  70. HALSRC += $(CHIBIOS)/os/hal/src/hal_sio.c
  71. endif
  72. ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),)
  73. HALSRC += $(CHIBIOS)/os/hal/src/hal_spi.c
  74. endif
  75. ifneq ($(findstring HAL_USE_TRNG TRUE,$(HALCONF)),)
  76. HALSRC += $(CHIBIOS)/os/hal/src/hal_trng.c
  77. endif
  78. ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),)
  79. HALSRC += $(CHIBIOS)/os/hal/src/hal_uart.c
  80. endif
  81. ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),)
  82. HALSRC += $(CHIBIOS)/os/hal/src/hal_usb.c
  83. endif
  84. ifneq ($(findstring HAL_USE_WDG TRUE,$(HALCONF)),)
  85. HALSRC += $(CHIBIOS)/os/hal/src/hal_wdg.c
  86. endif
  87. ifneq ($(findstring HAL_USE_WSPI TRUE,$(HALCONF)),)
  88. HALSRC += $(CHIBIOS)/os/hal/src/hal_wspi.c
  89. endif
  90. else
  91. HALSRC = $(CHIBIOS)/os/hal/src/hal.c \
  92. $(CHIBIOS)/os/hal/src/hal_buffers.c \
  93. $(CHIBIOS)/os/hal/src/hal_queues.c \
  94. $(CHIBIOS)/os/hal/src/hal_mmcsd.c \
  95. $(CHIBIOS)/os/hal/src/hal_adc.c \
  96. $(CHIBIOS)/os/hal/src/hal_can.c \
  97. $(CHIBIOS)/os/hal/src/hal_crypto.c \
  98. $(CHIBIOS)/os/hal/src/hal_dac.c \
  99. $(CHIBIOS)/os/hal/src/hal_gpt.c \
  100. $(CHIBIOS)/os/hal/src/hal_i2c.c \
  101. $(CHIBIOS)/os/hal/src/hal_i2s.c \
  102. $(CHIBIOS)/os/hal/src/hal_icu.c \
  103. $(CHIBIOS)/os/hal/src/hal_eicu.c \
  104. $(CHIBIOS)/os/hal/src/hal_mac.c \
  105. $(CHIBIOS)/os/hal/src/hal_mmc_spi.c \
  106. $(CHIBIOS)/os/hal/src/hal_pal.c \
  107. $(CHIBIOS)/os/hal/src/hal_pwm.c \
  108. $(CHIBIOS)/os/hal/src/hal_rtc.c \
  109. $(CHIBIOS)/os/hal/src/hal_sdc.c \
  110. $(CHIBIOS)/os/hal/src/hal_serial.c \
  111. $(CHIBIOS)/os/hal/src/hal_serial_usb.c \
  112. $(CHIBIOS)/os/hal/src/hal_sio.c \
  113. $(CHIBIOS)/os/hal/src/hal_spi.c \
  114. $(CHIBIOS)/os/hal/src/hal_st.c \
  115. $(CHIBIOS)/os/hal/src/hal_trng.c \
  116. $(CHIBIOS)/os/hal/src/hal_uart.c \
  117. $(CHIBIOS)/os/hal/src/hal_usb.c \
  118. $(CHIBIOS)/os/hal/src/hal_wdg.c \
  119. $(CHIBIOS)/os/hal/src/hal_wspi.c
  120. endif
  121. # Required include directories
  122. HALINC = $(CHIBIOS)/os/hal/include
  123. # Shared variables
  124. ALLCSRC += $(HALSRC)
  125. ALLINC += $(HALINC)