Subversion Repositories FlightCtrl

Rev

Rev 2349 | Details | Compare with Previous | Last modification | View Log | RSS feed

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