1 | #
|
---|
2 | # Copyright (c) 2011 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 | # Tool suffix when cross-compiling
|
---|
20 | #CROSS_COMPILE = ../../../../tools/CodeSourcery_arm/bin/arm-none-eabi-
|
---|
21 | #CROSS_COMPILE = C:/CodeSourcery_2011.03-42/bin/arm-none-eabi-
|
---|
22 | CROSS_COMPILE = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-
|
---|
23 |
|
---|
24 | # Compilation tools
|
---|
25 | AR = $(CROSS_COMPILE)ar
|
---|
26 | CC = $(CROSS_COMPILE)gcc
|
---|
27 | CXX = $(CROSS_COMPILE)g++
|
---|
28 | AS = $(CROSS_COMPILE)as
|
---|
29 | GDB = $(CROSS_COMPILE)gdb
|
---|
30 | SIZE = $(CROSS_COMPILE)size
|
---|
31 | NM = $(CROSS_COMPILE)nm
|
---|
32 | OBJCOPY = $(CROSS_COMPILE)objcopy
|
---|
33 |
|
---|
34 | ifeq ($(OS),Windows_NT)
|
---|
35 | RM=cs-rm -Rf
|
---|
36 | else
|
---|
37 | RM=rm -Rf
|
---|
38 | endif
|
---|
39 |
|
---|
40 | SEP=\\
|
---|
41 |
|
---|
42 | # ---------------------------------------------------------------------------------------
|
---|
43 | # C Flags
|
---|
44 |
|
---|
45 | CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
|
---|
46 | CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
|
---|
47 | CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
---|
48 | CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
---|
49 | CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
|
---|
50 | CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
|
---|
51 | CFLAGS += -Wmissing-prototypes -Wmissing-declarations
|
---|
52 | CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
---|
53 | CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
|
---|
54 | CFLAGS += -Wunreachable-code
|
---|
55 | CFLAGS += -Wcast-align
|
---|
56 |
|
---|
57 | CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -nostdlib -std=c99
|
---|
58 | CFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D$(VARIANT)
|
---|
59 |
|
---|
60 | # To reduce application size use only integer printf function.
|
---|
61 | CFLAGS += -Dprintf=iprintf
|
---|
62 |
|
---|
63 | # ---------------------------------------------------------------------------------------
|
---|
64 | # CPP Flags
|
---|
65 |
|
---|
66 | CPPFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2
|
---|
67 | CPPFLAGS += -Wmain -Wparentheses -Wcast-align -Wunreachable-code
|
---|
68 | CPPFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
---|
69 | CPPFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
---|
70 | CPPFLAGS += -Wshadow -Wpointer-arith -Wwrite-strings
|
---|
71 | CPPFLAGS += -Wsign-compare -Waggregate-return -Wmissing-declarations
|
---|
72 | CPPFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
---|
73 | CPPFLAGS += -Wpacked -Wredundant-decls -Winline -Wlong-long
|
---|
74 |
|
---|
75 | #-fno-rtti -fno-exceptions
|
---|
76 | CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -std=c++98
|
---|
77 | CPPFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP)
|
---|
78 |
|
---|
79 | # To reduce application size use only integer printf function.
|
---|
80 | CPPFLAGS += -Dprintf=iprintf
|
---|
81 |
|
---|
82 | # ---------------------------------------------------------------------------------------
|
---|
83 | # ASM Flags
|
---|
84 |
|
---|
85 | ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES)
|
---|