Makefile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. ##############################################################################
  2. # Build global options
  3. # NOTE: Can be overridden externally.
  4. #
  5. # Compiler options here.
  6. ifeq ($(USE_OPT),)
  7. USE_OPT = -O3 -ggdb -fomit-frame-pointer -falign-functions=16
  8. endif
  9. # C specific options here (added to USE_OPT).
  10. ifeq ($(USE_COPT),)
  11. USE_COPT =
  12. endif
  13. # C++ specific options here (added to USE_OPT).
  14. ifeq ($(USE_CPPOPT),)
  15. USE_CPPOPT = -fno-rtti
  16. endif
  17. # Enable this if you want the linker to remove unused code and data.
  18. ifeq ($(USE_LINK_GC),)
  19. USE_LINK_GC = yes
  20. endif
  21. # Linker extra options here.
  22. ifeq ($(USE_LDOPT),)
  23. USE_LDOPT = -lm
  24. endif
  25. # Enable this if you want link time optimizations (LTO).
  26. ifeq ($(USE_LTO),)
  27. USE_LTO = yes
  28. endif
  29. # Enable this if you want to see the full log while compiling.
  30. ifeq ($(USE_VERBOSE_COMPILE),)
  31. USE_VERBOSE_COMPILE = no
  32. endif
  33. # If enabled, this option makes the build process faster by not compiling
  34. # modules not used in the current configuration.
  35. ifeq ($(USE_SMART_BUILD),)
  36. USE_SMART_BUILD = yes
  37. endif
  38. #
  39. # Build global options
  40. ##############################################################################
  41. ##############################################################################
  42. # Architecture or project specific options
  43. #
  44. # Stack size to be allocated to the Cortex-M process stack. This stack is
  45. # the stack used by the main() thread.
  46. ifeq ($(USE_PROCESS_STACKSIZE),)
  47. USE_PROCESS_STACKSIZE = 0x400
  48. endif
  49. # Stack size to the allocated to the Cortex-M main/exceptions stack. This
  50. # stack is used for processing interrupts and exceptions.
  51. ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
  52. USE_EXCEPTIONS_STACKSIZE = 0x400
  53. endif
  54. # Enables the use of FPU (no, softfp, hard).
  55. ifeq ($(USE_FPU),)
  56. USE_FPU = no
  57. endif
  58. # FPU-related options.
  59. ifeq ($(USE_FPU_OPT),)
  60. USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16
  61. endif
  62. #
  63. # Architecture or project specific options
  64. ##############################################################################
  65. ##############################################################################
  66. # Project, target, sources and paths
  67. #
  68. # Define project name here
  69. PROJECT = acc-tst
  70. # Target settings.
  71. MCU = cortex-m3
  72. # Imported source files and paths.
  73. CHIBIOS := C:/MCU/ChibiOS_21.11.2
  74. CONFDIR := ./cfg
  75. BUILDDIR := ./build
  76. DEPDIR := ./.dep
  77. # Licensing files.
  78. include $(CHIBIOS)/os/license/license.mk
  79. # Startup files.
  80. include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
  81. # HAL-OSAL files (optional).
  82. include $(CHIBIOS)/os/hal/hal.mk
  83. include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
  84. #include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F103RB/board.mk
  85. include board/board.mk
  86. include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
  87. # RTOS files (optional).
  88. include $(CHIBIOS)/os/rt/rt.mk
  89. include $(CHIBIOS)/os/common/ports/ARMv7-M/compilers/GCC/mk/port.mk
  90. # Auto-build files in ./source recursively.
  91. include $(CHIBIOS)/tools/mk/autobuild.mk
  92. # Other files (optional).
  93. include $(CHIBIOS)/os/hal/lib/streams/streams.mk
  94. #include $(CHIBIOS)/os/various/shell/shell.mk
  95. # µGFX
  96. GFXLIB = C:/MCU/uGFX
  97. include $(GFXLIB)/gfx.mk
  98. include $(GFXLIB)/drivers/gdisp/LGDP4532/driver.mk # your board
  99. include $(GFXLIB)/drivers/ginput/toggle/Pal/driver.mk # your button keys
  100. include $(GFXLIB)/drivers/ginput/touch/ADS7843/driver.mk # your touch panel
  101. # Define linker script file here
  102. LDSCRIPT= $(STARTUPLD)/STM32F103xE.ld
  103. # C sources that can be compiled in ARM or THUMB mode depending on the global
  104. # setting.
  105. CSRC = $(ALLCSRC) \
  106. $(GFXSRC) \
  107. src/INA3221.c \
  108. src/buttons.c \
  109. src/main.c
  110. # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  111. # setting.
  112. CPPSRC = $(ALLCPPSRC) \
  113. # List ASM source files here.
  114. ASMSRC = $(ALLASMSRC)
  115. # List ASM with preprocessor source files here.
  116. ASMXSRC = $(ALLXASMSRC)
  117. # Inclusion directories.
  118. INCDIR = $(CONFDIR) $(ALLINC) $(GFXINC)
  119. # Define C warning options here.
  120. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
  121. # Define C++ warning options here.
  122. CPPWARN = -Wall -Wextra -Wundef
  123. #
  124. # Project, target, sources and paths
  125. ##############################################################################
  126. ##############################################################################
  127. # Start of user section
  128. #
  129. # List all user C define here, like -D_DEBUG=1
  130. UDEFS =
  131. # Define ASM defines here
  132. UADEFS =
  133. # List all user directories here
  134. UINCDIR = inc
  135. # List the user directory to look for the libraries here
  136. ULIBDIR =
  137. # List all user libraries here
  138. ULIBS =
  139. #
  140. # End of user section
  141. ##############################################################################
  142. ##############################################################################
  143. # Common rules
  144. #
  145. RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk
  146. include $(RULESPATH)/arm-none-eabi.mk
  147. include $(RULESPATH)/rules.mk
  148. #
  149. # Common rules
  150. ##############################################################################
  151. ##############################################################################
  152. # Custom rules
  153. #
  154. flash: all
  155. @flash.cmd
  156. #
  157. # Custom rules
  158. ##############################################################################