My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

libvariant_arduino_due_x.mk 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #
  2. # Copyright (c) 2012 Arduino. All right reserved.
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation; either
  7. # version 2.1 of the License, or (at your option) any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. # See the GNU Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with this library; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. #
  18. # Makefile for compiling libArduino
  19. .SUFFIXES: .o .a .c .s
  20. CHIP=__SAM3X8E__
  21. VARIANT=arduino_due_x
  22. LIBNAME=libvariant_$(VARIANT)
  23. TOOLCHAIN=gcc
  24. #-------------------------------------------------------------------------------
  25. # Path
  26. #-------------------------------------------------------------------------------
  27. # Output directories
  28. OUTPUT_BIN = ../../../cores/arduino
  29. # Libraries
  30. PROJECT_BASE_PATH = ..
  31. SYSTEM_PATH = ../../../system
  32. CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
  33. CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
  34. CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
  35. #CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
  36. ARDUINO_PATH = ../../../cores/arduino
  37. VARIANT_BASE_PATH = ../../../variants
  38. VARIANT_PATH = ../../../variants/$(VARIANT)
  39. #-------------------------------------------------------------------------------
  40. # Files
  41. #-------------------------------------------------------------------------------
  42. #vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
  43. vpath %.cpp $(PROJECT_BASE_PATH)
  44. VPATH+=$(PROJECT_BASE_PATH)
  45. INCLUDES =
  46. #INCLUDES += -I$(PROJECT_BASE_PATH)
  47. INCLUDES += -I$(ARDUINO_PATH)
  48. INCLUDES += -I$(ARDUINO_PATH)/USB
  49. INCLUDES += -I$(SYSTEM_PATH)
  50. INCLUDES += -I$(SYSTEM_PATH)/libsam
  51. INCLUDES += -I$(SYSTEM_PATH)/USBHost
  52. INCLUDES += -I$(VARIANT_BASE_PATH)
  53. INCLUDES += -I$(VARIANT_PATH)
  54. INCLUDES += -I$(CMSIS_ARM_PATH)
  55. INCLUDES += -I$(CMSIS_ATMEL_PATH)
  56. #-------------------------------------------------------------------------------
  57. ifdef DEBUG
  58. include debug.mk
  59. else
  60. include release.mk
  61. endif
  62. #-------------------------------------------------------------------------------
  63. # Tools
  64. #-------------------------------------------------------------------------------
  65. include $(TOOLCHAIN).mk
  66. #-------------------------------------------------------------------------------
  67. ifdef DEBUG
  68. OUTPUT_OBJ=debug
  69. OUTPUT_LIB_POSTFIX=dbg
  70. else
  71. OUTPUT_OBJ=release
  72. OUTPUT_LIB_POSTFIX=rel
  73. endif
  74. OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_$(OUTPUT_LIB_POSTFIX).a
  75. OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
  76. #-------------------------------------------------------------------------------
  77. # C source files and objects
  78. #-------------------------------------------------------------------------------
  79. C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
  80. C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
  81. # during development, remove some files
  82. C_OBJ_FILTER=
  83. C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
  84. #-------------------------------------------------------------------------------
  85. # CPP source files and objects
  86. #-------------------------------------------------------------------------------
  87. CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp)
  88. CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
  89. # during development, remove some files
  90. CPP_OBJ_FILTER=
  91. CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
  92. #-------------------------------------------------------------------------------
  93. # Assembler source files and objects
  94. #-------------------------------------------------------------------------------
  95. A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
  96. A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
  97. # during development, remove some files
  98. A_OBJ_FILTER=
  99. A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
  100. #-------------------------------------------------------------------------------
  101. # Rules
  102. #-------------------------------------------------------------------------------
  103. all: $(VARIANT)
  104. $(VARIANT): create_output $(OUTPUT_LIB)
  105. .PHONY: create_output
  106. create_output:
  107. @echo ------------------------------------------------------------------------------------
  108. @echo -------------------------
  109. @echo --- Preparing variant $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
  110. @echo -------------------------
  111. # @echo *$(INCLUDES)
  112. # @echo -------------------------
  113. # @echo *$(C_SRC)
  114. # @echo -------------------------
  115. # @echo *$(C_OBJ)
  116. # @echo -------------------------
  117. # @echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
  118. # @echo -------------------------
  119. # @echo *$(CPP_SRC)
  120. # @echo -------------------------
  121. # @echo *$(CPP_OBJ)
  122. # @echo -------------------------
  123. # @echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
  124. # @echo -------------------------
  125. # @echo *$(A_SRC)
  126. # @echo -------------------------
  127. -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
  128. @echo ------------------------------------------------------------------------------------
  129. $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
  130. # @"$(CC)" -v -c $(CFLAGS) $< -o $@
  131. @"$(CC)" -c $(CFLAGS) $< -o $@
  132. $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
  133. # @"$(CC)" -c $(CPPFLAGS) $< -o $@
  134. @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
  135. $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
  136. @"$(AS)" -c $(ASFLAGS) $< -o $@
  137. $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
  138. @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
  139. @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
  140. .PHONY: clean
  141. clean:
  142. @echo ------------------------------------------------------------------------------------
  143. @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
  144. -@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
  145. -@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
  146. @echo ------------------------------------------------------------------------------------