[136] | 1 | #
|
---|
| 2 | # Copyright (c) 2014 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 |
|
---|
| 19 | # Compilation tools
|
---|
| 20 | AR = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-ar
|
---|
| 21 | CC = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-gcc
|
---|
| 22 | #CXX = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-g++
|
---|
| 23 | CXX = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-gcc
|
---|
| 24 | AS = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-as
|
---|
| 25 | GDB = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-gdb
|
---|
| 26 | SIZE = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-size
|
---|
| 27 | NM = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-nm
|
---|
| 28 | OBJCOPY = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-objcopy
|
---|
| 29 |
|
---|
| 30 | RM=rm -Rf
|
---|
| 31 |
|
---|
| 32 | SEP=\\
|
---|
| 33 |
|
---|
| 34 | # ---------------------------------------------------------------------------------------
|
---|
| 35 | # C Flags
|
---|
| 36 |
|
---|
| 37 | CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
|
---|
| 38 | CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
|
---|
| 39 | CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
---|
| 40 | CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
---|
| 41 | CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
|
---|
| 42 | CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
|
---|
| 43 | CFLAGS += -Wmissing-prototypes -Wmissing-declarations
|
---|
| 44 | CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
---|
| 45 | CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
|
---|
| 46 | CFLAGS += -Wunreachable-code
|
---|
| 47 | CFLAGS += -Wcast-align
|
---|
| 48 |
|
---|
| 49 | # -flto
|
---|
| 50 | CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m0plus -mthumb -mlong-calls -ffunction-sections -nostdlib -std=c99
|
---|
| 51 | CFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(DEVICE) -D$(VARIANT)
|
---|
| 52 |
|
---|
| 53 | # To reduce application size use only integer printf function.
|
---|
| 54 | CFLAGS += -Dprintf=iprintf
|
---|
| 55 | # -u _scanf_float -u _printf_float
|
---|
| 56 |
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | # ---------------------------------------------------------------------------------------
|
---|
| 60 | # CPP Flags
|
---|
| 61 |
|
---|
| 62 | CPPFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2
|
---|
| 63 | CPPFLAGS += -Wmain -Wparentheses -Wcast-align -Wunreachable-code
|
---|
| 64 | CPPFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
---|
| 65 | CPPFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
---|
| 66 | CPPFLAGS += -Wshadow -Wpointer-arith -Wwrite-strings
|
---|
| 67 | CPPFLAGS += -Wsign-compare -Waggregate-return -Wmissing-declarations
|
---|
| 68 | CPPFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
---|
| 69 | CPPFLAGS += -Wpacked -Wredundant-decls -Winline -Wlong-long
|
---|
| 70 |
|
---|
| 71 | #-fno-rtti -fno-exceptions -flto
|
---|
| 72 | CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m0plus -mthumb -mlong-calls -ffunction-sections -fdata-sections -std=c++98
|
---|
| 73 | CPPFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(DEVICE)
|
---|
| 74 |
|
---|
| 75 | # To reduce application size use only integer printf function.
|
---|
| 76 | CPPFLAGS += -Dprintf=iprintf
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | # ---------------------------------------------------------------------------------------
|
---|
| 81 | # ASM Flags
|
---|
| 82 |
|
---|
| 83 | ASFLAGS = -mcpu=cortex-m0plus -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES)
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | # ---------------------------------------------------------------------------------------
|
---|
| 88 | # LD Flags
|
---|
| 89 |
|
---|
| 90 | #--nostartfiles -flto
|
---|
| 91 | LDFLAGS= -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
|
---|
| 92 |
|
---|