Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 -m32
  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 =
  24. endif
  25. # Enable this if you want link time optimizations (LTO).
  26. ifeq ($(USE_LTO),)
  27. USE_LTO = no
  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. #
  45. # Architecture or project specific options
  46. ##############################################################################
  47. ##############################################################################
  48. # Project, sources and paths
  49. #
  50. # Define project name here
  51. PROJECT = ch
  52. # Imported source files and paths
  53. CHIBIOS = ../../..
  54. CONFDIR := ./cfg
  55. BUILDDIR := ./build
  56. DEPDIR := ./.dep
  57. # Licensing files.
  58. include $(CHIBIOS)/os/license/license.mk
  59. # Startup files.
  60. # HAL-OSAL files (optional).
  61. include $(CHIBIOS)/os/hal/hal.mk
  62. include $(CHIBIOS)/os/hal/boards/simulator/board.mk
  63. include $(CHIBIOS)/os/hal/ports/simulator/posix/platform.mk
  64. include $(CHIBIOS)/os/hal/osal/rt/osal.mk
  65. # RTOS files (optional).
  66. include $(CHIBIOS)/os/rt/rt.mk
  67. include $(CHIBIOS)/os/common/ports/SIMIA32/compilers/GCC/port.mk
  68. # Other files (optional).
  69. include $(CHIBIOS)/test/lib/test.mk
  70. include $(CHIBIOS)/test/rt/rt_test.mk
  71. include $(CHIBIOS)/test/oslib/oslib_test.mk
  72. include $(CHIBIOS)/os/hal/lib/streams/streams.mk
  73. include $(CHIBIOS)/os/various/shell/shell.mk
  74. # C sources here.
  75. CSRC = $(ALLCSRC) \
  76. $(TESTSRC) \
  77. main.c
  78. # C++ sources here.
  79. CPPSRC = $(ALLCPPSRC)
  80. # List ASM source files here.
  81. ASMSRC = $(ALLASMSRC)
  82. ASMXSRC = $(ALLXASMSRC)
  83. INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
  84. #
  85. # Project, sources and paths
  86. ##############################################################################
  87. ##############################################################################
  88. # Start of user section
  89. #
  90. # List all user C define here, like -D_DEBUG=1
  91. UDEFS = -DSIMULATOR
  92. # Define ASM defines here
  93. UADEFS =
  94. # List all user directories here
  95. UINCDIR =
  96. # List the user directory to look for the libraries here
  97. ULIBDIR =
  98. # List all user libraries here
  99. ULIBS =
  100. #
  101. # End of user defines
  102. ##############################################################################
  103. ##############################################################################
  104. # Compiler settings
  105. #
  106. TRGT =
  107. CC = $(TRGT)gcc
  108. CPPC = $(TRGT)g++
  109. # Enable loading with g++ only if you need C++ runtime support.
  110. # NOTE: You can use C++ even without C++ support if you are careful. C++
  111. # runtime support makes code size explode.
  112. LD = $(TRGT)gcc
  113. #LD = $(TRGT)g++
  114. CP = $(TRGT)objcopy
  115. AS = $(TRGT)gcc -x assembler-with-cpp
  116. AR = $(TRGT)ar
  117. OD = $(TRGT)objdump
  118. SZ = $(TRGT)size
  119. HEX = $(CP) -O ihex
  120. BIN = $(CP) -O binary
  121. COV = gcov
  122. # Define C warning options here
  123. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
  124. # Define C++ warning options here
  125. CPPWARN = -Wall -Wextra -Wundef
  126. #
  127. # Compiler settings
  128. ##############################################################################
  129. RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
  130. include $(RULESPATH)/rules.mk