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