PD Buddy Sink Firmware
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Makefile 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. ##############################################################################
  2. # Build global options
  3. # NOTE: Can be overridden externally.
  4. #
  5. # Compiler options here.
  6. ifeq ($(USE_OPT),)
  7. USE_OPT = -O2 -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 = -std=c11
  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 =
  24. endif
  25. # Enable this if you want link time optimizations (LTO)
  26. ifeq ($(USE_LTO),)
  27. USE_LTO = yes
  28. endif
  29. # If enabled, this option allows to compile the application in THUMB mode.
  30. ifeq ($(USE_THUMB),)
  31. USE_THUMB = yes
  32. endif
  33. # Enable this if you want to see the full log while compiling.
  34. ifeq ($(USE_VERBOSE_COMPILE),)
  35. USE_VERBOSE_COMPILE = no
  36. endif
  37. # If enabled, this option makes the build process faster by not compiling
  38. # modules not used in the current configuration.
  39. ifeq ($(USE_SMART_BUILD),)
  40. USE_SMART_BUILD = yes
  41. endif
  42. #
  43. # Build global options
  44. ##############################################################################
  45. ##############################################################################
  46. # Architecture or project specific options
  47. #
  48. # Stack size to be allocated to the Cortex-M process stack. This stack is
  49. # the stack used by the main() thread.
  50. ifeq ($(USE_PROCESS_STACKSIZE),)
  51. USE_PROCESS_STACKSIZE = 0x200
  52. endif
  53. # Stack size to the allocated to the Cortex-M main/exceptions stack. This
  54. # stack is used for processing interrupts and exceptions.
  55. ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
  56. USE_EXCEPTIONS_STACKSIZE = 0x400
  57. endif
  58. #
  59. # Architecture or project specific options
  60. ##############################################################################
  61. ##############################################################################
  62. # Project, sources and paths
  63. #
  64. # Define project name here
  65. PROJECT = pd-buddy-firmware
  66. # Imported source files and paths
  67. CHIBIOS = ChibiOS
  68. # Startup files.
  69. include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
  70. # HAL-OSAL files (optional).
  71. include $(CHIBIOS)/os/hal/hal.mk
  72. include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk
  73. include $(CHIBIOS)/../boards/PD_BUDDY/board.mk
  74. include $(CHIBIOS)/os/hal/osal/rt/osal.mk
  75. # RTOS files (optional).
  76. include $(CHIBIOS)/os/rt/rt.mk
  77. include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
  78. # Other files (optional).
  79. include $(CHIBIOS)/test/rt/test.mk
  80. # Define linker script file here
  81. LDSCRIPT= $(STARTUPLD)/STM32F072xB.ld
  82. # C sources that can be compiled in ARM or THUMB mode depending on the global
  83. # setting.
  84. CSRC = $(STARTUPSRC) \
  85. $(KERNSRC) \
  86. $(PORTSRC) \
  87. $(OSALSRC) \
  88. $(HALSRC) \
  89. $(PLATFORMSRC) \
  90. $(BOARDSRC) \
  91. $(TESTSRC) \
  92. $(wildcard src/*.c)
  93. # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  94. # setting.
  95. CPPSRC =
  96. # C sources to be compiled in ARM mode regardless of the global setting.
  97. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  98. # option that results in lower performance and larger code size.
  99. ACSRC =
  100. # C++ sources to be compiled in ARM mode regardless of the global setting.
  101. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  102. # option that results in lower performance and larger code size.
  103. ACPPSRC =
  104. # C sources to be compiled in THUMB mode regardless of the global setting.
  105. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  106. # option that results in lower performance and larger code size.
  107. TCSRC =
  108. # C sources to be compiled in THUMB mode regardless of the global setting.
  109. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
  110. # option that results in lower performance and larger code size.
  111. TCPPSRC =
  112. # List ASM source files here
  113. ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
  114. INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
  115. $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
  116. $(CHIBIOS)/os/various \
  117. config
  118. #
  119. # Project, sources and paths
  120. ##############################################################################
  121. ##############################################################################
  122. # Compiler settings
  123. #
  124. MCU = cortex-m0
  125. #TRGT = arm-elf-
  126. TRGT = arm-none-eabi-
  127. CC = $(TRGT)gcc
  128. CPPC = $(TRGT)g++
  129. # Enable loading with g++ only if you need C++ runtime support.
  130. # NOTE: You can use C++ even without C++ support if you are careful. C++
  131. # runtime support makes code size explode.
  132. LD = $(TRGT)gcc
  133. #LD = $(TRGT)g++
  134. CP = $(TRGT)objcopy
  135. AS = $(TRGT)gcc -x assembler-with-cpp
  136. AR = $(TRGT)ar
  137. OD = $(TRGT)objdump
  138. SZ = $(TRGT)size
  139. HEX = $(CP) -O ihex
  140. BIN = $(CP) -O binary
  141. # ARM-specific options here
  142. AOPT =
  143. # THUMB-specific options here
  144. TOPT = -mthumb -DTHUMB
  145. # Define C warning options here
  146. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
  147. # Define C++ warning options here
  148. CPPWARN = -Wall -Wextra -Wundef
  149. #
  150. # Compiler settings
  151. ##############################################################################
  152. ##############################################################################
  153. # Start of user section
  154. #
  155. # List all user C define here, like -D_DEBUG=1
  156. UDEFS =
  157. # Define ASM defines here
  158. UADEFS =
  159. # List all user directories here
  160. UINCDIR =
  161. # List the user directory to look for the libraries here
  162. ULIBDIR =
  163. # List all user libraries here
  164. ULIBS =
  165. #
  166. # End of user defines
  167. ##############################################################################
  168. RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
  169. include $(RULESPATH)/rules.mk