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