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