Rev 2349 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2349 | Rev 2360 | ||
---|---|---|---|
1 | #-------------------------------------------------------------------- |
1 | #-------------------------------------------------------------------- |
2 | # MCU name |
2 | # MCU name |
3 | MCU = atmega1284p |
3 | MCU = atmega1284p |
4 | #MCU = atmega644p |
4 | #MCU = atmega644p |
5 | F_CPU = 20000000 |
5 | F_CPU = 20000000 |
6 | #------------------------------------------------------------------- |
6 | #------------------------------------------------------------------- |
7 | VERSION_MAJOR = 0 |
7 | VERSION_MAJOR = 0 |
8 | VERSION_MINOR = 91 |
8 | VERSION_MINOR = 91 |
9 | VERSION_PATCH = 11 |
9 | VERSION_PATCH = 11 |
10 | VERSION_SERIAL_MAJOR = 11 # Serial Protocol |
10 | VERSION_SERIAL_MAJOR = 11 # Serial Protocol |
11 | VERSION_SERIAL_MINOR = 0 # Serial Protocol |
11 | VERSION_SERIAL_MINOR = 0 # Serial Protocol |
12 | NC_SPI_COMPATIBLE = 55 # Navi-Kompatibilität |
12 | NC_SPI_COMPATIBLE = 55 # Navi-Kompatibilität |
13 | LIB_FC_COMPATIBLE = 3 # Library |
13 | LIB_FC_COMPATIBLE = 3 # Library |
- | 14 | MOD = ACC-HH_MartinR |
|
14 | #------------------------------------------------------------------- |
15 | #------------------------------------------------------------------- |
15 | # ATMEGA644: 63487 is maximum |
16 | # ATMEGA644: 63487 is maximum |
16 | #------------------------------------------------------------------- |
17 | #------------------------------------------------------------------- |
17 | # 0 a |
18 | # 0 a |
18 | # 1 b |
19 | # 1 b |
19 | # 2 c |
20 | # 2 c |
20 | # 3 d |
21 | # 3 d |
21 | # 4 e |
22 | # 4 e |
22 | # 5 f |
23 | # 5 f |
23 | # 6 g |
24 | # 6 g |
24 | # 7 h |
25 | # 7 h |
25 | # 8 i |
26 | # 8 i |
26 | # 9 j |
27 | # 9 j |
27 | # 10 k |
28 | # 10 k |
28 | # 11 L |
29 | # 11 L |
29 | #------------------------------------------------------------------- |
30 | #------------------------------------------------------------------- |
30 | 31 | ||
31 | # get SVN revision |
32 | # get SVN revision |
32 | REV := $(shell sh -c "cat .svn/entries | sed -n '4p'") |
33 | REV := $(shell sh -c "cat .svn/entries | sed -n '4p'") |
33 | 34 | ||
34 | ifeq ($(MCU), atmega1284p) |
35 | ifeq ($(MCU), atmega1284p) |
35 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
36 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
36 | HEX_NAME = MEGA1284P |
37 | HEX_NAME = MEGA1284P |
37 | LIBFC_EXT = 1284 |
38 | LIBFC_EXT = 1284 |
38 | endif |
39 | endif |
39 | 40 | ||
40 | ifeq ($(MCU), atmega644p) |
41 | ifeq ($(MCU), atmega644p) |
41 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
42 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
42 | HEX_NAME = MEGA644 |
43 | HEX_NAME = MEGA644 |
43 | LIBFC_EXT = 644 |
44 | LIBFC_EXT = 644 |
44 | endif |
45 | endif |
45 | 46 | ||
46 | ifeq ($(F_CPU), 16000000) |
47 | ifeq ($(F_CPU), 16000000) |
47 | QUARZ = 16MHZ |
48 | QUARZ = 16MHZ |
48 | endif |
49 | endif |
49 | 50 | ||
50 | ifeq ($(F_CPU), 20000000) |
51 | ifeq ($(F_CPU), 20000000) |
51 | QUARZ = 20MHZ |
52 | QUARZ = 20MHZ |
52 | endif |
53 | endif |
53 | 54 | ||
54 | 55 | ||
55 | # Output format. (can be srec, ihex, binary) |
56 | # Output format. (can be srec, ihex, binary) |
56 | FORMAT = ihex |
57 | FORMAT = ihex |
57 | 58 | ||
58 | # Target file name (without extension). |
59 | # Target file name (without extension). |
59 | 60 | ||
60 | ifeq ($(VERSION_PATCH), 0) |
61 | ifeq ($(VERSION_PATCH), 0) |
61 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a_SVN$(REV) |
62 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a_SVN$(REV)_$(MOD) |
62 | endif |
63 | endif |
63 | ifeq ($(VERSION_PATCH), 1) |
64 | ifeq ($(VERSION_PATCH), 1) |
64 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b_SVN$(REV) |
65 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b_SVN$(REV)_$(MOD) |
65 | endif |
66 | endif |
66 | ifeq ($(VERSION_PATCH), 2) |
67 | ifeq ($(VERSION_PATCH), 2) |
67 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)c_SVN$(REV) |
68 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)c_SVN$(REV)_$(MOD) |
68 | endif |
69 | endif |
69 | ifeq ($(VERSION_PATCH), 3) |
70 | ifeq ($(VERSION_PATCH), 3) |
70 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)d_SVN$(REV) |
71 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)d_SVN$(REV)_$(MOD) |
71 | endif |
72 | endif |
72 | ifeq ($(VERSION_PATCH), 4) |
73 | ifeq ($(VERSION_PATCH), 4) |
73 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)e_SVN$(REV) |
74 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)e_SVN$(REV)_$(MOD) |
74 | endif |
75 | endif |
75 | ifeq ($(VERSION_PATCH), 5) |
76 | ifeq ($(VERSION_PATCH), 5) |
76 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)f_SVN$(REV) |
77 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)f_SVN$(REV)_$(MOD) |
77 | endif |
78 | endif |
78 | ifeq ($(VERSION_PATCH), 6) |
79 | ifeq ($(VERSION_PATCH), 6) |
79 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)g_SVN$(REV) |
80 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)g_SVN$(REV)_$(MOD) |
80 | endif |
81 | endif |
81 | ifeq ($(VERSION_PATCH), 7) |
82 | ifeq ($(VERSION_PATCH), 7) |
82 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)h_SVN$(REV) |
83 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)h_SVN$(REV)_$(MOD) |
83 | endif |
84 | endif |
84 | ifeq ($(VERSION_PATCH), 8) |
85 | ifeq ($(VERSION_PATCH), 8) |
85 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)i_SVN$(REV) |
86 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)i_SVN$(REV)_$(MOD) |
86 | endif |
87 | endif |
87 | ifeq ($(VERSION_PATCH), 9) |
88 | ifeq ($(VERSION_PATCH), 9) |
88 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)j_SVN$(REV) |
89 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)j_SVN$(REV)_$(MOD) |
89 | endif |
90 | endif |
90 | ifeq ($(VERSION_PATCH), 10) |
91 | ifeq ($(VERSION_PATCH), 10) |
91 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)k_SVN$(REV) |
92 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)k_SVN$(REV)_$(MOD) |
92 | endif |
93 | endif |
93 | ifeq ($(VERSION_PATCH), 11) |
94 | ifeq ($(VERSION_PATCH), 11) |
94 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)L_SVN$(REV) |
95 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)L_SVN$(REV)_$(MOD) |
95 | endif |
96 | endif |
96 | ifeq ($(VERSION_PATCH), 12) |
97 | ifeq ($(VERSION_PATCH), 12) |
97 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)m_SVN$(REV) |
98 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)m_SVN$(REV)_$(MOD) |
98 | endif |
99 | endif |
99 | ifeq ($(VERSION_PATCH), 13) |
100 | ifeq ($(VERSION_PATCH), 13) |
100 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)n_SVN$(REV) |
101 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)n_SVN$(REV)_$(MOD) |
101 | endif |
102 | endif |
102 | ifeq ($(VERSION_PATCH), 14) |
103 | ifeq ($(VERSION_PATCH), 14) |
103 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)o_SVN$(REV) |
104 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)o_SVN$(REV)_$(MOD) |
104 | endif |
105 | endif |
105 | ifeq ($(VERSION_PATCH), 15) |
106 | ifeq ($(VERSION_PATCH), 15) |
106 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)p_SVN$(REV) |
107 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)p_SVN$(REV)_$(MOD) |
107 | endif |
108 | endif |
108 | ifeq ($(VERSION_PATCH), 16) |
109 | ifeq ($(VERSION_PATCH), 16) |
109 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)q_SVN$(REV) |
110 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)q_SVN$(REV)_$(MOD) |
110 | endif |
111 | endif |
111 | ifeq ($(VERSION_PATCH), 17) |
112 | ifeq ($(VERSION_PATCH), 17) |
112 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)r_SVN$(REV) |
113 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)r_SVN$(REV)_$(MOD) |
113 | endif |
114 | endif |
114 | ifeq ($(VERSION_PATCH), 18) |
115 | ifeq ($(VERSION_PATCH), 18) |
115 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)s_SVN$(REV) |
116 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)s_SVN$(REV)_$(MOD) |
116 | endif |
117 | endif |
117 | ifeq ($(VERSION_PATCH), 19) |
118 | ifeq ($(VERSION_PATCH), 19) |
118 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)t_SVN$(REV) |
119 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)t_SVN$(REV)_$(MOD) |
119 | endif |
120 | endif |
120 | ifeq ($(VERSION_PATCH), 20) |
121 | ifeq ($(VERSION_PATCH), 20) |
121 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)u_SVN$(REV) |
122 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)u_SVN$(REV)_$(MOD) |
122 | endif |
123 | endif |
123 | ifeq ($(VERSION_PATCH), 21) |
124 | ifeq ($(VERSION_PATCH), 21) |
124 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)v_SVN$(REV) |
125 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)v_SVN$(REV)_$(MOD) |
125 | endif |
126 | endif |
126 | ifeq ($(VERSION_PATCH), 22) |
127 | ifeq ($(VERSION_PATCH), 22) |
127 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)w_SVN$(REV) |
128 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)w_SVN$(REV)_$(MOD) |
128 | endif |
129 | endif |
129 | ifeq ($(VERSION_PATCH), 23) |
130 | ifeq ($(VERSION_PATCH), 23) |
130 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)x_SVN$(REV) |
131 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)x_SVN$(REV)_$(MOD) |
131 | endif |
132 | endif |
132 | ifeq ($(VERSION_PATCH), 24) |
133 | ifeq ($(VERSION_PATCH), 24) |
133 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)y_SVN$(REV) |
134 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)y_SVN$(REV)_$(MOD) |
134 | endif |
135 | endif |
135 | ifeq ($(VERSION_PATCH), 25) |
136 | ifeq ($(VERSION_PATCH), 25) |
136 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)z_SVN$(REV) |
137 | TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)z_SVN$(REV)_$(MOD) |
137 | endif |
138 | endif |
138 | 139 | ||
139 | 140 | ||
140 | # Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
141 | # Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
141 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
142 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
142 | OPT = s |
143 | OPT = s |
143 | #OPT = 2 |
144 | #OPT = 2 |
144 | 145 | ||
145 | ########################################################################################################## |
146 | ########################################################################################################## |
146 | # List C source files here. (C dependencies are automatically generated.) |
147 | # List C source files here. (C dependencies are automatically generated.) |
147 | SRC = main.c uart.c timer0.c analog.c menu.c eeprom.c |
148 | SRC = main.c uart.c timer0.c analog.c menu.c eeprom.c |
148 | SRC += twimaster.c rc.c fc.c GPS.c spi.c led.c Spektrum.c |
149 | SRC += twimaster.c rc.c fc.c GPS.c spi.c led.c Spektrum.c |
149 | SRC += mymath.c jetimenu.c capacity.c debug.c |
150 | SRC += mymath.c jetimenu.c capacity.c debug.c |
150 | SRC += hottmenu.c sbus.c user_receiver.c |
151 | SRC += hottmenu.c sbus.c user_receiver.c |
151 | SRC += jeti_ex.c |
152 | SRC += jeti_ex.c |
152 | ########################################################################################################## |
153 | ########################################################################################################## |
153 | 154 | ||
154 | 155 | ||
155 | # List Assembler source files here. |
156 | # List Assembler source files here. |
156 | # Make them always end in a capital .S. Files ending in a lowercase .s |
157 | # Make them always end in a capital .S. Files ending in a lowercase .s |
157 | # will not be considered source files but generated files (assembler |
158 | # will not be considered source files but generated files (assembler |
158 | # output from the compiler), and will be deleted upon "make clean"! |
159 | # output from the compiler), and will be deleted upon "make clean"! |
159 | # Even though the DOS/Win* filesystem matches both .s and .S the same, |
160 | # Even though the DOS/Win* filesystem matches both .s and .S the same, |
160 | # it will preserve the spelling of the filenames, and gcc itself does |
161 | # it will preserve the spelling of the filenames, and gcc itself does |
161 | # care about how the name is spelled on its command-line. |
162 | # care about how the name is spelled on its command-line. |
162 | ASRC = isqrt.S |
163 | ASRC = isqrt.S |
163 | 164 | ||
164 | 165 | ||
165 | 166 | ||
166 | # List any extra directories to look for include files here. |
167 | # List any extra directories to look for include files here. |
167 | # Each directory must be seperated by a space. |
168 | # Each directory must be seperated by a space. |
168 | EXTRAINCDIRS = |
169 | EXTRAINCDIRS = |
169 | 170 | ||
170 | 171 | ||
171 | # Optional compiler flags. |
172 | # Optional compiler flags. |
172 | # -g: generate debugging information (for GDB, or for COFF conversion) |
173 | # -g: generate debugging information (for GDB, or for COFF conversion) |
173 | # -O*: optimization level |
174 | # -O*: optimization level |
174 | # -f...: tuning, see gcc manual and avr-libc documentation |
175 | # -f...: tuning, see gcc manual and avr-libc documentation |
175 | # -Wall...: warning level |
176 | # -Wall...: warning level |
176 | # -Wa,...: tell GCC to pass this to the assembler. |
177 | # -Wa,...: tell GCC to pass this to the assembler. |
177 | # -ahlms: create assembler listing |
178 | # -ahlms: create assembler listing |
178 | CFLAGS = -O$(OPT) -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=$(<:%.c=%.lst) $(patsubst %,-I%,$(EXTRAINCDIRS)) |
179 | CFLAGS = -O$(OPT) -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=$(<:%.c=%.lst) $(patsubst %,-I%,$(EXTRAINCDIRS)) |
179 | 180 | ||
180 | 181 | ||
181 | # Set a "language standard" compiler flag. |
182 | # Set a "language standard" compiler flag. |
182 | # Unremark just one line below to set the language standard to use. |
183 | # Unremark just one line below to set the language standard to use. |
183 | # gnu99 = C99 + GNU extensions. See GCC manual for more information. |
184 | # gnu99 = C99 + GNU extensions. See GCC manual for more information. |
184 | #CFLAGS += -std=c89 |
185 | #CFLAGS += -std=c89 |
185 | #CFLAGS += -std=gnu89 |
186 | #CFLAGS += -std=gnu89 |
186 | #CFLAGS += -std=c99 |
187 | #CFLAGS += -std=c99 |
187 | CFLAGS += -std=gnu99 |
188 | CFLAGS += -std=gnu99 |
188 | 189 | ||
189 | # shrink code size |
190 | # shrink code size |
190 | CFLAGS += -mtiny-stack |
191 | CFLAGS += -mtiny-stack |
191 | #CFLAGS += -fno-inline-functions |
192 | #CFLAGS += -fno-inline-functions |
192 | CFLAGS += -mcall-prologues |
193 | CFLAGS += -mcall-prologues |
193 | 194 | ||
194 | CFLAGS += -DF_CPU=$(F_CPU) -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_PATCH=$(VERSION_PATCH) -DVERSION_SERIAL_MAJOR=$(VERSION_SERIAL_MAJOR) -DVERSION_SERIAL_MINOR=$(VERSION_SERIAL_MINOR) -DNC_SPI_COMPATIBLE=$(NC_SPI_COMPATIBLE) -DLIB_FC_COMPATIBLE=$(LIB_FC_COMPATIBLE) |
195 | CFLAGS += -DF_CPU=$(F_CPU) -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_PATCH=$(VERSION_PATCH) -DVERSION_SERIAL_MAJOR=$(VERSION_SERIAL_MAJOR) -DVERSION_SERIAL_MINOR=$(VERSION_SERIAL_MINOR) -DNC_SPI_COMPATIBLE=$(NC_SPI_COMPATIBLE) -DLIB_FC_COMPATIBLE=$(LIB_FC_COMPATIBLE) |
195 | 196 | ||
196 | 197 | ||
197 | # Optional assembler flags. |
198 | # Optional assembler flags. |
198 | # -Wa,...: tell GCC to pass this to the assembler. |
199 | # -Wa,...: tell GCC to pass this to the assembler. |
199 | # -ahlms: create listing |
200 | # -ahlms: create listing |
200 | # -gstabs: have the assembler create line number information; note that |
201 | # -gstabs: have the assembler create line number information; note that |
201 | # for use in COFF files, additional information about filenames |
202 | # for use in COFF files, additional information about filenames |
202 | # and function names needs to be present in the assembler source |
203 | # and function names needs to be present in the assembler source |
203 | # files -- see avr-libc docs [FIXME: not yet described there] |
204 | # files -- see avr-libc docs [FIXME: not yet described there] |
204 | ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
205 | ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
205 | 206 | ||
206 | 207 | ||
207 | 208 | ||
208 | # Optional linker flags. |
209 | # Optional linker flags. |
209 | # -Wl,...: tell GCC to pass this to linker. |
210 | # -Wl,...: tell GCC to pass this to linker. |
210 | # -Map: create map file |
211 | # -Map: create map file |
211 | # --cref: add cross reference to map file |
212 | # --cref: add cross reference to map file |
212 | LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
213 | LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
213 | 214 | ||
214 | # Additional libraries |
215 | # Additional libraries |
215 | 216 | ||
216 | # Minimalistic printf version |
217 | # Minimalistic printf version |
217 | #LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
218 | #LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
218 | 219 | ||
219 | # Floating point printf version (requires -lm below) |
220 | # Floating point printf version (requires -lm below) |
220 | #LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
221 | #LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
221 | 222 | ||
222 | # -lm = math library |
223 | # -lm = math library |
223 | LDFLAGS += -lm |
224 | LDFLAGS += -lm |
224 | 225 | ||
225 | LDFLAGS += libfc$(LIBFC_EXT).a |
226 | LDFLAGS += libfc$(LIBFC_EXT).a |
226 | 227 | ||
227 | ##LDFLAGS += -T./linkerfile/avr5.x |
228 | ##LDFLAGS += -T./linkerfile/avr5.x |
228 | 229 | ||
229 | 230 | ||
230 | 231 | ||
231 | # Programming support using avrdude. Settings and variables. |
232 | # Programming support using avrdude. Settings and variables. |
232 | 233 | ||
233 | # Programming hardware: alf avr910 avrisp bascom bsd |
234 | # Programming hardware: alf avr910 avrisp bascom bsd |
234 | # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
235 | # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
235 | # |
236 | # |
236 | # Type: avrdude -c ? |
237 | # Type: avrdude -c ? |
237 | # to get a full listing. |
238 | # to get a full listing. |
238 | # |
239 | # |
239 | #AVRDUDE_PROGRAMMER = dt006 |
240 | #AVRDUDE_PROGRAMMER = dt006 |
240 | #AVRDUDE_PROGRAMMER = stk200 |
241 | #AVRDUDE_PROGRAMMER = stk200 |
241 | #AVRDUDE_PROGRAMMER = ponyser |
242 | #AVRDUDE_PROGRAMMER = ponyser |
242 | AVRDUDE_PROGRAMMER = avrispv2 |
243 | AVRDUDE_PROGRAMMER = avrispv2 |
243 | #falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
244 | #falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
244 | 245 | ||
245 | #AVRDUDE_PORT = com1 # programmer connected to serial device |
246 | #AVRDUDE_PORT = com1 # programmer connected to serial device |
246 | #AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
247 | #AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
247 | AVRDUDE_PORT = usb # programmer connected to USB |
248 | AVRDUDE_PORT = usb # programmer connected to USB |
248 | 249 | ||
249 | #AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
250 | #AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
250 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
251 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
251 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
252 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
252 | 253 | ||
253 | #avrdude -c avrispv2 -P usb -p m32 -U flash:w:blink.hex |
254 | #avrdude -c avrispv2 -P usb -p m32 -U flash:w:blink.hex |
254 | AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
255 | AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
255 | 256 | ||
256 | # Uncomment the following if you want avrdude's erase cycle counter. |
257 | # Uncomment the following if you want avrdude's erase cycle counter. |
257 | # Note that this counter needs to be initialized first using -Yn, |
258 | # Note that this counter needs to be initialized first using -Yn, |
258 | # see avrdude manual. |
259 | # see avrdude manual. |
259 | #AVRDUDE_ERASE += -y |
260 | #AVRDUDE_ERASE += -y |
260 | 261 | ||
261 | # Uncomment the following if you do /not/ wish a verification to be |
262 | # Uncomment the following if you do /not/ wish a verification to be |
262 | # performed after programming the device. |
263 | # performed after programming the device. |
263 | AVRDUDE_FLAGS += -V |
264 | AVRDUDE_FLAGS += -V |
264 | 265 | ||
265 | # Increase verbosity level. Please use this when submitting bug |
266 | # Increase verbosity level. Please use this when submitting bug |
266 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
267 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
267 | # to submit bug reports. |
268 | # to submit bug reports. |
268 | #AVRDUDE_FLAGS += -v -v |
269 | #AVRDUDE_FLAGS += -v -v |
269 | 270 | ||
270 | # --------------------------------------------------------------------------- |
271 | # --------------------------------------------------------------------------- |
271 | # Define directories, if needed. |
272 | # Define directories, if needed. |
272 | DIRAVR = c:/winavr |
273 | DIRAVR = c:/winavr |
273 | DIRAVRBIN = $(DIRAVR)/bin |
274 | DIRAVRBIN = $(DIRAVR)/bin |
274 | DIRAVRUTILS = $(DIRAVR)/utils/bin |
275 | DIRAVRUTILS = $(DIRAVR)/utils/bin |
275 | DIRINC = . |
276 | DIRINC = . |
276 | DIRLIB = $(DIRAVR)/avr/lib |
277 | DIRLIB = $(DIRAVR)/avr/lib |
277 | 278 | ||
278 | 279 | ||
279 | # Define programs and commands. |
280 | # Define programs and commands. |
280 | SHELL = sh |
281 | SHELL = sh |
281 | 282 | ||
282 | CC = avr-gcc |
283 | CC = avr-gcc |
283 | 284 | ||
284 | OBJCOPY = avr-objcopy |
285 | OBJCOPY = avr-objcopy |
285 | OBJDUMP = avr-objdump |
286 | OBJDUMP = avr-objdump |
286 | SIZE = avr-size |
287 | SIZE = avr-size |
287 | 288 | ||
288 | # Programming support using avrdude. |
289 | # Programming support using avrdude. |
289 | AVRDUDE = avrdude |
290 | AVRDUDE = avrdude |
290 | 291 | ||
291 | REMOVE = rm -f |
292 | REMOVE = rm -f |
292 | COPY = cp |
293 | COPY = cp |
293 | 294 | ||
294 | HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
295 | HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
295 | ELFSIZE = $(SIZE) -x -A $(TARGET).elf |
296 | ELFSIZE = $(SIZE) -x -A $(TARGET).elf |
296 | LIMITS = $(SIZE) --mcu=$(MCU) -C $(TARGET).elf |
297 | LIMITS = $(SIZE) --mcu=$(MCU) -C $(TARGET).elf |
297 | 298 | ||
298 | 299 | ||
299 | # Define Messages |
300 | # Define Messages |
300 | # English |
301 | # English |
301 | MSG_ERRORS_NONE = Errors: none |
302 | MSG_ERRORS_NONE = Errors: none |
302 | MSG_BEGIN = -------- begin -------- |
303 | MSG_BEGIN = -------- begin -------- |
303 | MSG_END = -------- end -------- |
304 | MSG_END = -------- end -------- |
304 | MSG_SIZE_BEFORE = Size before: |
305 | MSG_SIZE_BEFORE = Size before: |
305 | MSG_SIZE_AFTER = Size after: |
306 | MSG_SIZE_AFTER = Size after: |
306 | MSG_COFF = Converting to AVR COFF: |
307 | MSG_COFF = Converting to AVR COFF: |
307 | MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
308 | MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
308 | MSG_FLASH = Creating load file for Flash: |
309 | MSG_FLASH = Creating load file for Flash: |
309 | MSG_EEPROM = Creating load file for EEPROM: |
310 | MSG_EEPROM = Creating load file for EEPROM: |
310 | MSG_EXTENDED_LISTING = Creating Extended Listing: |
311 | MSG_EXTENDED_LISTING = Creating Extended Listing: |
311 | MSG_SYMBOL_TABLE = Creating Symbol Table: |
312 | MSG_SYMBOL_TABLE = Creating Symbol Table: |
312 | MSG_LINKING = Linking: |
313 | MSG_LINKING = Linking: |
313 | MSG_COMPILING = Compiling: |
314 | MSG_COMPILING = Compiling: |
314 | MSG_ASSEMBLING = Assembling: |
315 | MSG_ASSEMBLING = Assembling: |
315 | MSG_CLEANING = Cleaning project: |
316 | MSG_CLEANING = Cleaning project: |
316 | 317 | ||
317 | 318 | ||
318 | # Define all object files. |
319 | # Define all object files. |
319 | OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
320 | OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
320 | 321 | ||
321 | # Define all listing files. |
322 | # Define all listing files. |
322 | LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
323 | LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
323 | 324 | ||
324 | # Combine all necessary flags and optional flags. |
325 | # Combine all necessary flags and optional flags. |
325 | # Add target processor to flags. |
326 | # Add target processor to flags. |
326 | #ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
327 | #ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
327 | ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
328 | ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
328 | ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
329 | ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
329 | 330 | ||
330 | 331 | ||
331 | # Default target. |
332 | # Default target. |
332 | all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex sizeafter finished end |
333 | all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex sizeafter finished end |
333 | 334 | ||
334 | 335 | ||
335 | # Eye candy. |
336 | # Eye candy. |
336 | # AVR Studio 3.x does not check make's exit code but relies on |
337 | # AVR Studio 3.x does not check make's exit code but relies on |
337 | # the following magic strings to be generated by the compile job. |
338 | # the following magic strings to be generated by the compile job. |
338 | begin: |
339 | begin: |
339 | @echo |
340 | @echo |
340 | @echo $(MSG_BEGIN) |
341 | @echo $(MSG_BEGIN) |
341 | 342 | ||
342 | finished: |
343 | finished: |
343 | @echo $(MSG_ERRORS_NONE) |
344 | @echo $(MSG_ERRORS_NONE) |
344 | 345 | ||
345 | end: |
346 | end: |
346 | @echo $(MSG_END) |
347 | @echo $(MSG_END) |
347 | @echo |
348 | @echo |
348 | 349 | ||
349 | 350 | ||
350 | # Display size of file. |
351 | # Display size of file. |
351 | sizebefore: |
352 | sizebefore: |
352 | @if [ -f $(TARGET).elf ]; then echo Size before:; $(ELFSIZE); $(HEXSIZE); $(LIMITS); echo; fi |
353 | @if [ -f $(TARGET).elf ]; then echo Size before:; $(ELFSIZE); $(HEXSIZE); $(LIMITS); echo; fi |
353 | sizeafter: |
354 | sizeafter: |
354 | @if [ -f $(TARGET).elf ]; then echo Size after:; $(ELFSIZE); $(HEXSIZE); $(LIMITS); echo; fi |
355 | @if [ -f $(TARGET).elf ]; then echo Size after:; $(ELFSIZE); $(HEXSIZE); $(LIMITS); echo; fi |
355 | 356 | ||
356 | 357 | ||
357 | # Display compiler version information. |
358 | # Display compiler version information. |
358 | gccversion : |
359 | gccversion : |
359 | @$(CC) --version |
360 | @$(CC) --version |
360 | 361 | ||
361 | 362 | ||
362 | # Convert ELF to COFF for use in debugging / simulating in |
363 | # Convert ELF to COFF for use in debugging / simulating in |
363 | # AVR Studio or VMLAB. |
364 | # AVR Studio or VMLAB. |
364 | COFFCONVERT=$(OBJCOPY) --debugging \ |
365 | COFFCONVERT=$(OBJCOPY) --debugging \ |
365 | --change-section-address .data-0x800000 \ |
366 | --change-section-address .data-0x800000 \ |
366 | --change-section-address .bss-0x800000 \ |
367 | --change-section-address .bss-0x800000 \ |
367 | --change-section-address .noinit-0x800000 \ |
368 | --change-section-address .noinit-0x800000 \ |
368 | --change-section-address .eeprom-0x810000 |
369 | --change-section-address .eeprom-0x810000 |
369 | 370 | ||
370 | 371 | ||
371 | coff: $(TARGET).elf |
372 | coff: $(TARGET).elf |
372 | @echo |
373 | @echo |
373 | @echo $(MSG_COFF) $(TARGET).cof |
374 | @echo $(MSG_COFF) $(TARGET).cof |
374 | $(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
375 | $(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
375 | 376 | ||
376 | 377 | ||
377 | extcoff: $(TARGET).elf |
378 | extcoff: $(TARGET).elf |
378 | @echo |
379 | @echo |
379 | @echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
380 | @echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
380 | $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
381 | $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
381 | 382 | ||
382 | 383 | ||
383 | 384 | ||
384 | 385 | ||
385 | # Program the device. |
386 | # Program the device. |
386 | program: $(TARGET).hex $(TARGET).eep |
387 | program: $(TARGET).hex $(TARGET).eep |
387 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
388 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
388 | 389 | ||
389 | 390 | ||
390 | 391 | ||
391 | 392 | ||
392 | # Create final output files (.hex, .eep) from ELF output file. |
393 | # Create final output files (.hex, .eep) from ELF output file. |
393 | %.hex: %.elf |
394 | %.hex: %.elf |
394 | @echo |
395 | @echo |
395 | @echo $(MSG_FLASH) $@ |
396 | @echo $(MSG_FLASH) $@ |
396 | $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
397 | $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
397 | 398 | ||
398 | %.eep: %.elf |
399 | %.eep: %.elf |
399 | @echo |
400 | @echo |
400 | @echo $(MSG_EEPROM) $@ |
401 | @echo $(MSG_EEPROM) $@ |
401 | -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
402 | -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
402 | --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
403 | --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
403 | 404 | ||
404 | # Create extended listing file from ELF output file. |
405 | # Create extended listing file from ELF output file. |
405 | %.lss: %.elf |
406 | %.lss: %.elf |
406 | @echo |
407 | @echo |
407 | @echo $(MSG_EXTENDED_LISTING) $@ |
408 | @echo $(MSG_EXTENDED_LISTING) $@ |
408 | $(OBJDUMP) -h -S $< > $@ |
409 | $(OBJDUMP) -h -S $< > $@ |
409 | 410 | ||
410 | # Create a symbol table from ELF output file. |
411 | # Create a symbol table from ELF output file. |
411 | %.sym: %.elf |
412 | %.sym: %.elf |
412 | @echo |
413 | @echo |
413 | @echo $(MSG_SYMBOL_TABLE) $@ |
414 | @echo $(MSG_SYMBOL_TABLE) $@ |
414 | avr-nm -n $< > $@ |
415 | avr-nm -n $< > $@ |
415 | 416 | ||
416 | 417 | ||
417 | 418 | ||
418 | # Link: create ELF output file from object files. |
419 | # Link: create ELF output file from object files. |
419 | .SECONDARY : $(TARGET).elf |
420 | .SECONDARY : $(TARGET).elf |
420 | .PRECIOUS : $(OBJ) |
421 | .PRECIOUS : $(OBJ) |
421 | %.elf: $(OBJ) |
422 | %.elf: $(OBJ) |
422 | @echo |
423 | @echo |
423 | @echo $(MSG_LINKING) $@ |
424 | @echo $(MSG_LINKING) $@ |
424 | $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
425 | $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
425 | 426 | ||
426 | 427 | ||
427 | # Compile: create object files from C source files. |
428 | # Compile: create object files from C source files. |
428 | %.o : %.c |
429 | %.o : %.c |
429 | @echo |
430 | @echo |
430 | @echo $(MSG_COMPILING) $< |
431 | @echo $(MSG_COMPILING) $< |
431 | $(CC) -c $(ALL_CFLAGS) $< -o $@ |
432 | $(CC) -c $(ALL_CFLAGS) $< -o $@ |
432 | 433 | ||
433 | 434 | ||
434 | # Compile: create assembler files from C source files. |
435 | # Compile: create assembler files from C source files. |
435 | %.s : %.c |
436 | %.s : %.c |
436 | $(CC) -S $(ALL_CFLAGS) $< -o $@ |
437 | $(CC) -S $(ALL_CFLAGS) $< -o $@ |
437 | 438 | ||
438 | 439 | ||
439 | # Assemble: create object files from assembler source files. |
440 | # Assemble: create object files from assembler source files. |
440 | %.o : %.S |
441 | %.o : %.S |
441 | @echo |
442 | @echo |
442 | @echo $(MSG_ASSEMBLING) $< |
443 | @echo $(MSG_ASSEMBLING) $< |
443 | $(CC) -c $(ALL_ASFLAGS) $< -o $@ |
444 | $(CC) -c $(ALL_ASFLAGS) $< -o $@ |
444 | 445 | ||
445 | 446 | ||
446 | 447 | ||
447 | 448 | ||
448 | 449 | ||
449 | 450 | ||
450 | # Target: clean project. |
451 | # Target: clean project. |
451 | clean: begin clean_list finished end |
452 | clean: begin clean_list finished end |
452 | 453 | ||
453 | clean_list : |
454 | clean_list : |
454 | @echo |
455 | @echo |
455 | @echo $(MSG_CLEANING) |
456 | @echo $(MSG_CLEANING) |
456 | $(REMOVE) Flight-Ctrl_*.hex |
457 | $(REMOVE) Flight-Ctrl_*.hex |
457 | $(REMOVE) Flight-Ctrl_*.eep |
458 | $(REMOVE) Flight-Ctrl_*.eep |
458 | $(REMOVE) $(TARGET).obj |
459 | $(REMOVE) $(TARGET).obj |
459 | $(REMOVE) $(TARGET).cof |
460 | $(REMOVE) $(TARGET).cof |
460 | $(REMOVE) Flight-Ctrl_*.elf |
461 | $(REMOVE) Flight-Ctrl_*.elf |
461 | $(REMOVE) Flight-Ctrl_*.map |
462 | $(REMOVE) Flight-Ctrl_*.map |
462 | $(REMOVE) $(TARGET).obj |
463 | $(REMOVE) $(TARGET).obj |
463 | $(REMOVE) $(TARGET).a90 |
464 | $(REMOVE) $(TARGET).a90 |
464 | $(REMOVE) Flight-Ctrl_*.sym |
465 | $(REMOVE) Flight-Ctrl_*.sym |
465 | $(REMOVE) $(TARGET).lnk |
466 | $(REMOVE) $(TARGET).lnk |
466 | $(REMOVE) $(TARGET).lss |
467 | $(REMOVE) $(TARGET).lss |
467 | $(REMOVE) $(OBJ) |
468 | $(REMOVE) $(OBJ) |
468 | $(REMOVE) $(LST) |
469 | $(REMOVE) $(LST) |
469 | $(REMOVE) $(SRC:.c=.s) |
470 | $(REMOVE) $(SRC:.c=.s) |
470 | $(REMOVE) $(SRC:.c=.d) |
471 | $(REMOVE) $(SRC:.c=.d) |
471 | $(REMOVE) $(SRC:.c=.o) |
472 | $(REMOVE) $(SRC:.c=.o) |
472 | 473 | ||
473 | 474 | ||
474 | # Automatically generate C source code dependencies. |
475 | # Automatically generate C source code dependencies. |
475 | # (Code originally taken from the GNU make user manual and modified |
476 | # (Code originally taken from the GNU make user manual and modified |
476 | # (See README.txt Credits).) |
477 | # (See README.txt Credits).) |
477 | # |
478 | # |
478 | # Note that this will work with sh (bash) and sed that is shipped with WinAVR |
479 | # Note that this will work with sh (bash) and sed that is shipped with WinAVR |
479 | # (see the SHELL variable defined above). |
480 | # (see the SHELL variable defined above). |
480 | # This may not work with other shells or other seds. |
481 | # This may not work with other shells or other seds. |
481 | # |
482 | # |
482 | %.d: %.c |
483 | %.d: %.c |
483 | set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
484 | set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
484 | | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
485 | | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
485 | [ -s $@ ] || rm -f $@ |
486 | [ -s $@ ] || rm -f $@ |
486 | 487 | ||
487 | 488 | ||
488 | # Remove the '-' if you want to see the dependency files generated. |
489 | # Remove the '-' if you want to see the dependency files generated. |
489 | -include $(SRC:%.c=%.d) |
490 | -include $(SRC:%.c=%.d) |
490 | 491 | ||
491 | 492 | ||
492 | 493 | ||
493 | # Listing of phony targets. |
494 | # Listing of phony targets. |
494 | .PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
495 | .PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
495 | clean clean_list program |
496 | clean clean_list program |
496 | 497 |