Disable menu timeout.
[bertos.git] / config.mk
1 #
2 # $Id$
3 # Copyright 2002,2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
4 # All rights reserved.
5 #
6 # Based on:
7 #   GCC-AVR standard Makefile part 1
8 #   Volker Oth 1/2000
9 #
10 # Author: Bernardo Innocenti <bernie@develer.com>
11 #
12 # $Log$
13 # Revision 1.4  2006/05/27 22:41:46  bernie
14 # Tweak optimization flags for loops.
15 #
16 # Revision 1.3  2006/05/18 00:40:10  bernie
17 # Setup for AVR development.
18 #
19 # Revision 1.2  2006/03/27 04:48:33  bernie
20 # Add CXXFLAGS; Add recursive targets.
21 #
22 # Revision 1.1  2006/03/22 09:51:53  bernie
23 # Add build infrastructure.
24 #
25 #
26
27 #
28 # Programmer type
29 #
30 # AVR ISP dongle that blows up easily
31 DPROG = -V -c stk500 -P /dev/ttyS0
32
33 # STK200 parallel cable
34 #DPROG = -c stk200 -E noreset
35
36 # PonyProg serial programmer
37 #DPROG = -c dasa2
38
39 OPTCFLAGS = -ffunction-sections -fdata-sections -funsafe-loop-optimizations
40
41 # For AVRStudio
42 #DEBUGCFLAGS = -gdwarf-2
43
44 # For GDB
45 DEBUGCFLAGS = -ggdb
46
47 #
48 # define some variables based on the AVR base path in $(AVR)
49 #
50 CROSS   = 
51 CC      = $(CROSS)gcc
52 AS      = $(CC) -x assembler-with-cpp
53 LD      = $(CC)
54 OBJCOPY = $(CROSS)objcopy
55 INSTALL = cp -a
56 RM      = rm -f
57 RM_R    = rm -rf
58 RN      = mv
59 MKDIR_P = mkdir -p
60
61 # For conversion from ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
62 COFFCONVERT=$(OBJCOPY) \
63         --debugging \
64         --change-section-address .data-0x800000 \
65         --change-section-address .bss-0x800000 \
66         --change-section-address .noinit-0x800000 \
67         --change-section-address .eeprom-0x810000
68
69 INCDIR  = -I. -Ihw
70 LIBDIR  = lib
71 OBJDIR  = obj
72 OUTDIR  = images
73 SHELL   = /bin/sh
74 DOXYGEN = doxygen
75 UISP    = uisp
76 AVRDUDE = avrdude
77 FLEXCAT = $(top_srcdir)/tools/flexcat/flexcat
78
79 # output format can be srec, ihex (avrobj is always created)
80 FORMAT = srec
81 #FORMAT = ihex
82
83 # Compiler flags for generating dependencies
84 DEP_FLAGS = -MMD -MP
85
86 # Compiler flags for generating source listings
87 LIST_FLAGS = -Wa,-anhlmsd=$(@:.o=.lst)
88
89 # Linker flags for generating map files
90 MAP_FLAGS = -Wl,-Map=$(@:%.elf=%.map),--cref
91
92 # Compiler warning flags for both C and C++
93 WARNFLAGS = \
94         -W -Wformat -Wall -Wundef -Wpointer-arith -Wcast-qual \
95         -Wcast-align -Wwrite-strings -Wsign-compare \
96         -Wmissing-prototypes -Wmissing-noreturn \
97         -Wextra -Wstrict-aliasing=2 \
98         -Wunsafe-loop-optimizations
99
100 # Compiler warning flags for C only
101 C_WARNFLAGS = \
102         -Wmissing-prototypes -Wstrict-prototypes
103
104 # Default C compiler flags
105 CFLAGS = $(INCDIR) $(OPTCFLAGS) $(DEBUGCFLAGS) $(WARNFLAGS) $(C_WARNFLAGS) \
106         $(DEP_FLAGS) $(LIST_FLAGS) -std=gnu99
107
108 # Default C++ compiler flags
109 CXXFLAGS = $(INCDIR) $(OPTCFLAGS) $(DEBUGCFLAGS) $(WARNFLAGS) \
110         $(DEP_FLAGS) $(LIST_FLAGS)
111
112 # Default compiler assembly flags
113 CPPAFLAGS = $(DEBUGCFLAGS) -MMD
114
115 # Default assembler flags
116 ASFLAGS = $(DEBUGCFLAGS)
117
118 # Default linker flags
119 #LDFLAGS = $(MAP_FLAGS)
120
121 #bernie: does not complain for missing symbols!
122 #LDFLAGS = $(MAP_FLAGS) -Wl,--gc-sections
123
124 # Flags for avrdude
125 AVRDUDEFLAGS = $(DPROG)
126
127 # additional libs
128 LIB = -lm