1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-18 12:54:25 +01:00

[sam] fixing makefiles for toolchain path containing spaces

This commit is contained in:
Thibault RICHARD 2012-04-11 19:26:06 +02:00
parent 431f3ea5fe
commit 0832334a71
9 changed files with 176 additions and 93 deletions

View File

@ -1,3 +1,21 @@
#
# Copyright (c) 2012 Arduino. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Makefile for compiling libArduino # Makefile for compiling libArduino
.SUFFIXES: .o .a .c .s .SUFFIXES: .o .a .c .s
@ -73,7 +91,7 @@ C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC))) C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
# during development, remove some files # during development, remove some files
C_OBJ_FILTER=dlib_lowlevel_sam3.o C_OBJ_FILTER=
C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP)) C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
@ -134,23 +152,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1

View File

@ -152,23 +152,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1

View File

@ -1,3 +1,21 @@
#
# Copyright (c) 2012 Arduino. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Makefile for compiling libArduino # Makefile for compiling libArduino
.SUFFIXES: .o .a .c .s .SUFFIXES: .o .a .c .s
@ -73,7 +91,7 @@ C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC))) C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
# during development, remove some files # during development, remove some files
C_OBJ_FILTER=dlib_lowlevel_sam3.o C_OBJ_FILTER=
C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP)) C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
@ -134,23 +152,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1

View File

@ -1,3 +1,21 @@
#
# Copyright (c) 2012 Arduino. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Makefile for compiling libArduino # Makefile for compiling libArduino
.SUFFIXES: .o .a .c .s .SUFFIXES: .o .a .c .s
@ -73,7 +91,7 @@ C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC))) C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
# during development, remove some files # during development, remove some files
C_OBJ_FILTER=dlib_lowlevel_sam3.o C_OBJ_FILTER=
C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP)) C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
@ -134,23 +152,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1

View File

@ -1,3 +1,21 @@
#
# Copyright (c) 2012 Arduino. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Makefile for compiling libArduino # Makefile for compiling libArduino
.SUFFIXES: .o .a .c .s .SUFFIXES: .o .a .c .s
@ -73,7 +91,7 @@ C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC))) C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
# during development, remove some files # during development, remove some files
C_OBJ_FILTER=dlib_lowlevel_sam3.o C_OBJ_FILTER=
C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP)) C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
@ -110,7 +128,7 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output .PHONY: create_output
create_output: create_output:
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN) @echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo ------------------------- @echo -------------------------
@echo *$(INCLUDES) @echo *$(INCLUDES)
@echo ------------------------- @echo -------------------------
@ -134,23 +152,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1

View File

@ -23,19 +23,24 @@
ifeq ("$(VARIANT)", "") ifeq ("$(VARIANT)", "")
#VARIANT=sam3s_ek #VARIANT=sam3s_ek
#VARIANT=sam3u_ek #VARIANT=sam3u_ek
VARIANT=arduino_due VARIANT=arduino_due_x
endif endif
ifeq ("$(VARIANT)", "sam3s_ek") ifeq ("$(VARIANT)", "sam3s_ek")
CHIP=__SAM3S4C__ CHIP=__SAM3S4C__
VARIANT_PATH = ../../../../atmel/sam/variants/$(VARIANT)
else ifeq ("$(VARIANT)", "sam3u_ek") else ifeq ("$(VARIANT)", "sam3u_ek")
CHIP=__SAM3U4E__ CHIP=__SAM3U4E__
VARIANT_PATH = ../../../../atmel/sam/variants/$(VARIANT)
else ifeq ("$(VARIANT)", "sam3x_ek") else ifeq ("$(VARIANT)", "sam3x_ek")
CHIP=__SAM3X8H__ CHIP=__SAM3X8H__
VARIANT_PATH = ../../../../atmel/sam/variants/$(VARIANT)
else ifeq ("$(VARIANT)", "arduino_due_u") else ifeq ("$(VARIANT)", "arduino_due_u")
CHIP=__SAM3U4E__ CHIP=__SAM3U4E__
VARIANT_PATH = ../../../../variants/$(VARIANT)
else ifeq ("$(VARIANT)", "arduino_due_x") else ifeq ("$(VARIANT)", "arduino_due_x")
CHIP=__SAM3X8E__ CHIP=__SAM3X8E__
VARIANT_PATH = ../../../../variants/$(VARIANT)
endif endif
TOOLCHAIN=gcc TOOLCHAIN=gcc
@ -47,8 +52,6 @@ TOOLCHAIN=gcc
# Libraries # Libraries
PROJECT_BASE_PATH = ./.. PROJECT_BASE_PATH = ./..
SYSTEM_PATH = ../../../../system SYSTEM_PATH = ../../../../system
CMSIS_BASE_PATH = $(SYSTEM_PATH)/CMSIS/Include
VARIANT_PATH = ../../../../variants/$(VARIANT)
ifeq ($(CHIP), __SAM3S4C__) ifeq ($(CHIP), __SAM3S4C__)
CHIP_NAME=sam3s4c CHIP_NAME=sam3s4c
@ -62,10 +65,16 @@ CHIP_SERIE=sam3n
else ifeq ($(CHIP), __SAM3X8H__) else ifeq ($(CHIP), __SAM3X8H__)
CHIP_NAME=sam3x8h CHIP_NAME=sam3x8h
CHIP_SERIE=sam3xa CHIP_SERIE=sam3xa
else ifeq ($(CHIP), __SAM3X8E__)
CHIP_NAME=sam3x8e
CHIP_SERIE=sam3xa
else else
endif endif
CMSIS_CHIP_PATH=$(SYSTEM_PATH)/libsam/cmsis/$(CHIP_SERIE) CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
# Output directories # Output directories
OUTPUT_PATH = debug_$(VARIANT) OUTPUT_PATH = debug_$(VARIANT)
@ -74,17 +83,19 @@ OUTPUT_PATH = debug_$(VARIANT)
# Files # Files
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH)/.. $(VARIANT_PATH) $(SYSTEM_PATH) $(CMSIS_BASE_PATH) vpath %.h $(PROJECT_BASE_PATH)/.. $(VARIANT_PATH) $(SYSTEM_PATH) $(CMSIS_ARM_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) vpath %.cpp $(PROJECT_BASE_PATH)
VPATH+=$(PROJECT_BASE_PATH) VPATH+=$(PROJECT_BASE_PATH)
INCLUDES = -I$(PROJECT_BASE_PATH)/.. INCLUDES = -I$(PROJECT_BASE_PATH)/..
INCLUDES += -I$(VARIANT_PATH) INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(VARIANT_PATH)/.. #INCLUDES += -I$(VARIANT_PATH)/..
INCLUDES += -I$(SYSTEM_PATH) #INCLUDES += -I$(SYSTEM_PATH)
INCLUDES += -I$(SYSTEM_PATH)/libsam INCLUDES += -I$(SYSTEM_PATH)/libsam
INCLUDES += -I$(CMSIS_BASE_PATH) INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
INCLUDES += -I$(CMSIS_CHIP_PATH)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ifdef DEBUG ifdef DEBUG
@ -162,26 +173,26 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CXX) -c $(CPPFLAGS) $< -o $@ # @"$(CXX)" -c $(CPPFLAGS) $< -o $@
# @$(CXX) -v -c $(CPPFLAGS) $< -o $@ @"$(CXX)" -v -c $(CPPFLAGS) $< -o $@
$(OUTPUT_BIN): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_BIN): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(CC) $(LIB_PATH) $(LDFLAGS) -T"$(VARIANT_PATH)/linker_scripts/gcc/flash.ld" -Wl,-Map,$(OUTPUT_PATH)/$@.map -o $(OUTPUT_PATH)/$@.elf $^ $(LIBS) @"$(CC)" $(LIB_PATH) $(LDFLAGS) -T"$(VARIANT_PATH)/linker_scripts/gcc/flash.ld" -Wl,-Map,$(OUTPUT_PATH)/$@.map -o $(OUTPUT_PATH)/$@.elf $^ $(LIBS)
# @$(CC) $(LIB_PATH) $(LDFLAGS) -T"$(VARIANT_PATH)/linker_scripts/gcc/sram.ld" -Wl,-Map,$(OUTPUT_PATH)/$@.map -o $(OUTPUT_PATH)/$@.elf $^ $(LIBS) # @"$(CC)" $(LIB_PATH) $(LDFLAGS) -T"$(VARIANT_PATH)/linker_scripts/gcc/sram.ld" -Wl,-Map,$(OUTPUT_PATH)/$@.map -o $(OUTPUT_PATH)/$@.elf $^ $(LIBS)
@$(NM) $(OUTPUT_PATH)/$@.elf >$(OUTPUT_PATH)/$@.elf.txt @"$(NM)" $(OUTPUT_PATH)/$@.elf >$(OUTPUT_PATH)/$@.elf.txt
@$(OBJCOPY) -O binary $(OUTPUT_PATH)/$@.elf $(OUTPUT_PATH)/$@.bin @"$(OBJCOPY)" -O binary $(OUTPUT_PATH)/$@.elf $(OUTPUT_PATH)/$@.bin
$(SIZE) $^ $(OUTPUT_PATH)/$@.elf $(SIZE) $^ $(OUTPUT_PATH)/$@.elf
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning test files @echo --- Cleaning test files
-@$(RM) $(OUTPUT_PATH)/test.o 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH)/test.o 1>NUL 2>&1
-@$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).elf 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH)/$(OUTPUT_BIN).elf 1>NUL 2>&1
-@$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).elf.txt 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH)/$(OUTPUT_BIN).elf.txt 1>NUL 2>&1
-@$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).bin 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH)/$(OUTPUT_BIN).bin 1>NUL 2>&1
-@$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).map 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH)/$(OUTPUT_BIN).map 1>NUL 2>&1
debug: test debug: test
@$(GDB) -x "$(VARIANT_PATH)/debug_scripts/gcc/$(VARIANT)_flash.gdb" -ex "reset" -readnow -se $(OUTPUT_PATH)/$(OUTPUT_BIN).elf @"$(GDB)" -x "$(VARIANT_PATH)/debug_scripts/gcc/$(VARIANT)_flash.gdb" -ex "reset" -readnow -se $(OUTPUT_PATH)/$(OUTPUT_BIN).elf
# @$(GDB) -w -x "$(VARIANT_PATH)/debug_scripts/gcc/$(VARIANT)_sram.gdb" -ex "reset" -readnow -se $(OUTPUT_PATH)/$(OUTPUT_BIN).elf # @"$(GDB)" -w -x "$(VARIANT_PATH)/debug_scripts/gcc/$(VARIANT)_sram.gdb" -ex "reset" -readnow -se $(OUTPUT_PATH)/$(OUTPUT_BIN).elf

View File

@ -176,9 +176,9 @@ $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(CHIP) files @echo --- Cleaning $(CHIP) files
-@$(RM) $(OUTPUT_PATH) 1>$(DEV_NUL) 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>$(DEV_NUL) 2>&1
-@$(RM) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)) 1>$(DEV_NUL) 2>&1 -@"$(RM)" $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)) 1>$(DEV_NUL) 2>&1
-@$(RM) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)).txt 1>$(DEV_NUL) 2>&1 -@"$(RM)" $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)).txt 1>$(DEV_NUL) 2>&1
# dependencies # dependencies
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: $(PROJECT_BASE_PATH)/chip.h $(wildcard $(PROJECT_BASE_PATH)/include/*.h) $(wildcard $(CMSIS_BASE_PATH)/*.h) $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: $(PROJECT_BASE_PATH)/chip.h $(wildcard $(PROJECT_BASE_PATH)/include/*.h) $(wildcard $(CMSIS_BASE_PATH)/*.h)

View File

@ -154,23 +154,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1

View File

@ -157,23 +157,23 @@ create_output:
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1 -@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @$(CC) -v -c $(CFLAGS) $< -o $@ # @"$(CC)" -v -c $(CFLAGS) $< -o $@
@$(CC) -c $(CFLAGS) $< -o $@ @"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @$(CC) -c $(CPPFLAGS) $< -o $@ # @"$(CC)" -c $(CPPFLAGS) $< -o $@
@$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@$(AS) -c $(ASFLAGS) $< -o $@ @"$(AS)" -c $(ASFLAGS) $< -o $@
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ)) $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@$(AR) -v -r "$(OUTPUT_BIN)/$@" $^ @"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
@$(NM) "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt" @"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
.PHONY: clean .PHONY: clean
clean: clean:
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o] @echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1 -@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1