Makefile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 -mno-spe -msoft-float
  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. # If enabled, this option allows to compile the application in VLE mode.
  30. ifeq ($(USE_VLE),)
  31. USE_VLE = 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 process stack. This stack is
  49. # the stack used by the main() thread.
  50. ifeq ($(USE_PROCESS_STACKSIZE),)
  51. USE_PROCESS_STACKSIZE = 0x400
  52. endif
  53. # Stack size to the allocated to the optional exceptions stack. This
  54. # stack is used for processing interrupts and exceptions.
  55. ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
  56. USE_EXCEPTIONS_STACKSIZE = 0
  57. endif
  58. #
  59. # Architecture or project specific options
  60. ##############################################################################
  61. ##############################################################################
  62. # Project, sources and paths
  63. #
  64. # Define project name here
  65. PROJECT = ch
  66. # Imported source files and paths
  67. CHIBIOS = ../../..
  68. # Startup files.
  69. include $(CHIBIOS)/os/common/startup/e200/compilers/GCC/mk/startup_spc560dxx.mk
  70. # HAL-OSAL files (optional).
  71. include $(CHIBIOS)/os/hal/hal.mk
  72. include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC560D/board.mk
  73. include $(CHIBIOS)/os/hal/ports/SPC5/SPC560Dxx/platform.mk
  74. include $(CHIBIOS)/os/hal/osal/nil/osal.mk
  75. # RTOS files (optional).
  76. include $(CHIBIOS)/os/nil/nil.mk
  77. include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/port.mk
  78. # Other files (optional).
  79. include $(CHIBIOS)/test/lib/test.mk
  80. include $(CHIBIOS)/test/nil/nil_test.mk
  81. include $(CHIBIOS)/test/oslib/oslib_test.mk
  82. # Define linker script file here
  83. LDSCRIPT= $(STARTUPLD)/SPC560D40.ld
  84. # C sources here.
  85. CSRC = $(STARTUPSRC) \
  86. $(KERNSRC) \
  87. $(PORTSRC) \
  88. $(OSALSRC) \
  89. $(HALSRC) \
  90. $(PLATFORMSRC) \
  91. $(BOARDSRC) \
  92. $(TESTSRC) \
  93. main.c
  94. # C++ sources here.
  95. CPPSRC =
  96. # List ASM source files here
  97. ASMSRC =
  98. ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
  99. INCDIR = $(CHIBIOS)/os/license \
  100. $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
  101. $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
  102. $(CHIBIOS)/os/various
  103. #
  104. # Project, sources and paths
  105. ##############################################################################
  106. ##############################################################################
  107. # Compiler settings
  108. #
  109. #MCU = e200zx -meabi -msdata=none -mnew-mnemonics -mregnames # HighTec
  110. MCU = e200z0 -meabi -msdata=none -mregnames # Free GCC
  111. #TRGT = ppc-vle-
  112. #TRGT = powerpc-eabivle-
  113. TRGT = ppc-freevle-eabi-
  114. CC = $(TRGT)gcc
  115. CPPC = $(TRGT)g++
  116. # Enable loading with g++ only if you need C++ runtime support.
  117. # NOTE: You can use C++ even without C++ support if you are careful. C++
  118. # runtime support makes code size explode.
  119. LD = $(TRGT)gcc
  120. #LD = $(TRGT)g++
  121. CP = $(TRGT)objcopy
  122. AS = $(TRGT)gcc -x assembler-with-cpp
  123. AR = $(TRGT)ar
  124. OD = $(TRGT)objdump
  125. SZ = $(TRGT)size
  126. HEX = $(CP) -O ihex
  127. MOT = $(CP) -O srec
  128. BIN = $(CP) -O binary
  129. # Define C warning options here
  130. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
  131. # Define C++ warning options here
  132. CPPWARN = -Wall -Wextra -Wundef
  133. #
  134. # Compiler settings
  135. ##############################################################################
  136. ##############################################################################
  137. # Start of user section
  138. #
  139. # List all user C define here, like -D_DEBUG=1
  140. UDEFS =
  141. # Define ASM defines here
  142. UADEFS =
  143. # List all user directories here
  144. UINCDIR =
  145. # List the user directory to look for the libraries here
  146. ULIBDIR =
  147. # List all user libraries here
  148. ULIBS =
  149. #
  150. # End of user defines
  151. ##############################################################################
  152. RULESPATH = $(CHIBIOS)/os/common/startup/e200/compilers/GCC
  153. include $(RULESPATH)/rules.mk