mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Moving sam3s peripheral library to more global sam library
This commit is contained in:
25
hardware/sam/system/libsam/build_gcc/Makefile
Normal file
25
hardware/sam/system/libsam/build_gcc/Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
# Makefile for compiling libchip
|
||||
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
all: libchip_sam3s4_gcc_dbg.a libchip_sam3s4_gcc_rel.a
|
||||
|
||||
libchip_sam3s4_gcc_dbg.a:
|
||||
@echo --- Making $@
|
||||
@$(MAKE) CHIP=sam3s4 DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3s.mk
|
||||
|
||||
libchip_sam3s4_gcc_rel.a:
|
||||
@echo --- Making $@
|
||||
@$(MAKE) CHIP=sam3s4 $(SUBMAKE_OPTIONS) -f sam3s.mk
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@echo --- Cleaning sam3s4 release and debug
|
||||
@$(MAKE) CHIP=sam3s4 $(SUBMAKE_OPTIONS) -f sam3s.mk $@
|
||||
@$(MAKE) CHIP=sam3s4 DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3s.mk $@
|
||||
|
||||
|
7
hardware/sam/system/libsam/build_gcc/debug.mk
Normal file
7
hardware/sam/system/libsam/build_gcc/debug.mk
Normal file
@ -0,0 +1,7 @@
|
||||
# Optimization level
|
||||
# -O1 Optimize
|
||||
# -O2 Optimize even more
|
||||
# -O3 Optimize yet more
|
||||
# -O0 Reduce compilation time and make debugging produce the expected results
|
||||
# -Os Optimize for size
|
||||
OPTIMIZATION = -g -O0 -DDEBUG
|
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/acc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/acc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/adc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/adc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/async.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/async.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/core_cm3.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/core_cm3.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/crccu.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/crccu.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/dacc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/dacc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/efc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/efc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/exceptions.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/exceptions.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/flashd.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/flashd.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pio.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pio.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pio_capture.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pio_capture.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pmc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pmc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pwmc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/pwmc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/rtc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/rtc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/rtt.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/rtt.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/spi.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/spi.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/spi_pdc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/spi_pdc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/ssc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/ssc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/tc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/tc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/twi.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/twi.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/twid.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/twid.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/usart.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/usart.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/wdt.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/debug_sam3s4/wdt.o
Normal file
Binary file not shown.
39
hardware/sam/system/libsam/build_gcc/gcc.mk
Normal file
39
hardware/sam/system/libsam/build_gcc/gcc.mk
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
# Tool suffix when cross-compiling
|
||||
#CROSS_COMPILE = ../../CodeSourcery_arm/bin/arm-none-eabi-
|
||||
CROSS_COMPILE = C:/CodeSourcery_2011.03-42/bin/arm-none-eabi-
|
||||
|
||||
# Compilation tools
|
||||
AR = $(CROSS_COMPILE)ar
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
AS = $(CROSS_COMPILE)as
|
||||
#LD = $(CROSS_COMPILE)ld
|
||||
#SIZE = $(CROSS_COMPILE)size
|
||||
NM = $(CROSS_COMPILE)nm
|
||||
#OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
RM=cs-rm -Rf
|
||||
SEP=/
|
||||
|
||||
# Flags
|
||||
|
||||
CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
|
||||
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
|
||||
CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
||||
CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
||||
CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
|
||||
CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
|
||||
CFLAGS += -Wmissing-prototypes -Wmissing-declarations
|
||||
CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
||||
CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
|
||||
CFLAGS += -Wunreachable-code
|
||||
CFLAGS += -Wcast-align
|
||||
#CFLAGS += -Wmissing-noreturn
|
||||
#CFLAGS += -Wconversion
|
||||
|
||||
# To reduce application size use only integer printf function.
|
||||
CFLAGS += -Dprintf=iprintf
|
||||
|
||||
CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections
|
||||
CFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP)
|
||||
|
||||
ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -a -g $(INCLUDES)
|
7
hardware/sam/system/libsam/build_gcc/release.mk
Normal file
7
hardware/sam/system/libsam/build_gcc/release.mk
Normal file
@ -0,0 +1,7 @@
|
||||
# Optimization level
|
||||
# -O1 Optimize
|
||||
# -O2 Optimize even more
|
||||
# -O3 Optimize yet more
|
||||
# -O0 Reduce compilation time and make debugging produce the expected results
|
||||
# -Os Optimize for size
|
||||
OPTIMIZATION = -Os
|
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/acc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/acc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/adc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/adc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/async.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/async.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/core_cm3.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/core_cm3.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/crccu.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/crccu.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/dacc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/dacc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/efc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/efc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/exceptions.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/exceptions.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/flashd.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/flashd.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/pio.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/pio.o
Normal file
Binary file not shown.
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/pmc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/pmc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/pwmc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/pwmc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/rtc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/rtc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/rtt.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/rtt.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/spi.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/spi.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/spi_pdc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/spi_pdc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/ssc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/ssc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/tc.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/tc.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/twi.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/twi.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/twid.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/twid.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/usart.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/usart.o
Normal file
Binary file not shown.
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/wdt.o
Normal file
BIN
hardware/sam/system/libsam/build_gcc/release_sam3s4/wdt.o
Normal file
Binary file not shown.
129
hardware/sam/system/libsam/build_gcc/sam3s.mk
Normal file
129
hardware/sam/system/libsam/build_gcc/sam3s.mk
Normal file
@ -0,0 +1,129 @@
|
||||
# Makefile for compiling libchip
|
||||
.SUFFIXES: .o .a .c .s
|
||||
SUB_MAKEFILES=debug.mk gcc.mk release.mk win.mk sam3s.mk
|
||||
|
||||
LIBNAME=libchip
|
||||
TOOLCHAIN=gcc
|
||||
|
||||
ifeq ($(CHIP),)
|
||||
$(error CHIP not defined)
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Path
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Output directories
|
||||
OUTPUT_BIN = ../lib
|
||||
|
||||
# Libraries
|
||||
PROJECT_BASE_PATH = ..
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Files
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
vpath %.h $(PROJECT_BASE_PATH)/include
|
||||
vpath %.c $(PROJECT_BASE_PATH)/source $(PROJECT_BASE_PATH)/cmsis
|
||||
vpath %.s $(PROJECT_BASE_PATH)/source $(PROJECT_BASE_PATH)/cmsis
|
||||
|
||||
VPATH+=$(PROJECT_BASE_PATH)/source
|
||||
VPATH+=$(PROJECT_BASE_PATH)/cmsis
|
||||
|
||||
INCLUDES = -I$(PROJECT_BASE_PATH)
|
||||
INCLUDES += -I$(PROJECT_BASE_PATH)/include
|
||||
INCLUDES += -I$(PROJECT_BASE_PATH)/cmsis
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
ifdef DEBUG
|
||||
include debug.mk
|
||||
else
|
||||
include release.mk
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Tools
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
include $(TOOLCHAIN).mk
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
ifdef DEBUG
|
||||
OUTPUT_OBJ=debug
|
||||
OUTPUT_LIB=$(LIBNAME)_$(CHIP)_$(TOOLCHAIN)_dbg.a
|
||||
else
|
||||
OUTPUT_OBJ=release
|
||||
OUTPUT_LIB=$(LIBNAME)_$(CHIP)_$(TOOLCHAIN)_rel.a
|
||||
endif
|
||||
|
||||
OUTPUT_PATH=$(OUTPUT_OBJ)_$(CHIP)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# C source files and objects
|
||||
#-------------------------------------------------------------------------------
|
||||
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/source/*.c)
|
||||
C_SRC+=$(wildcard $(PROJECT_BASE_PATH)/cmsis/*.c)
|
||||
|
||||
C_OBJ_TEMP=$(patsubst %.c, %.o, $(notdir $(C_SRC)))
|
||||
|
||||
# during development, remove some files
|
||||
C_OBJ_FILTER=pio_it.o
|
||||
|
||||
C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Assembler source files and objects
|
||||
#-------------------------------------------------------------------------------
|
||||
A_SRC=$(wildcard $(PROJECT_BASE_PATH)/source/*.s)
|
||||
A_SRC+=$(wildcard $(PROJECT_BASE_PATH)/cmsis/*.s)
|
||||
|
||||
A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
|
||||
|
||||
# during development, remove some files
|
||||
A_OBJ_FILTER=
|
||||
|
||||
A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
#-------------------------------------------------------------------------------
|
||||
all: $(CHIP)
|
||||
|
||||
$(CHIP): create_output $(OUTPUT_LIB)
|
||||
|
||||
.PHONY: create_output
|
||||
create_output:
|
||||
@echo --- Preparing $(CHIP) files $(OUTPUT_PATH) $(OUTPUT_BIN)
|
||||
# @echo -------------------------
|
||||
# @echo *$(C_SRC)
|
||||
# @echo -------------------------
|
||||
# @echo *$(C_OBJ)
|
||||
# @echo -------------------------
|
||||
# @echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
|
||||
# @echo -------------------------
|
||||
# @echo *$(A_SRC)
|
||||
# @echo -------------------------
|
||||
|
||||
-@mkdir $(subst /,$(SEP),$(OUTPUT_BIN)) 1>NUL 2>&1
|
||||
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
|
||||
|
||||
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
|
||||
# "$(CC)" -v -c $(CFLAGS) -Wa,aln=$(subst .o,.s,$@) $< -o $@
|
||||
@"$(CC)" -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
|
||||
@"$(AS)" -c $(ASFLAGS) $< -o $@
|
||||
|
||||
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
|
||||
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
|
||||
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@echo --- Cleaning $(CHIP) files
|
||||
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
|
||||
-@$(RM) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)) 1>NUL 2>&1
|
||||
-@$(RM) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)).txt 1>NUL 2>&1
|
||||
|
||||
# dependencies
|
||||
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: $(PROJECT_BASE_PATH)/chip.h $(wildcard $(PROJECT_BASE_PATH)/include/*.h) $(wildcard $(PROJECT_BASE_PATH)/cmsis/*.h)
|
Reference in New Issue
Block a user