OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [lwIP_AVR32_UC3/] [AT32UC3A/] [GCC/] [Makefile] - Blame information for rev 583

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 583 jeremybenn
# Hey Emacs, this is a -*- makefile -*-
2
 
3
# Goals available on make command line:
4
#
5
# [all]                   Default goal: build the project.
6
# clean                   Clean up the project.
7
# rebuild                 Rebuild the project.
8
# ccversion               Display CC version information.
9
# cppfiles  file.i        Generate preprocessed files from C source files.
10
# asfiles   file.x        Generate preprocessed assembler files from C and assembler source files.
11
# objfiles  file.o        Generate object files from C and assembler source files.
12
# a         file.a        Archive: create A output file from object files.
13
# elf       file.elf      Link: create ELF output file from object files.
14
# lss       file.lss      Create extended listing from target output file.
15
# sym       file.sym      Create symbol table from target output file.
16
# hex       file.hex      Create Intel HEX image from ELF output file.
17
# bin       file.bin      Create binary image from ELF output file.
18
# sizes                   Display target size information.
19
# isp                     Use ISP instead of JTAGICE mkII when programming.
20
# cpuinfo                 Get CPU information.
21
# halt                    Stop CPU execution.
22
# chiperase               Perform a JTAG Chip Erase command.
23
# erase                   Perform a flash chip erase.
24
# program                 Program MCU memory from ELF output file.
25
# secureflash             Protect chip by setting security bit.
26
# reset                   Reset MCU.
27
# debug                   Open a debug connection with the MCU.
28
# run                     Start CPU execution.
29
# readregs                Read CPU registers.
30
# doc                     Build the documentation.
31
# cleandoc                Clean up the documentation.
32
# rebuilddoc              Rebuild the documentation.
33
# verbose                 Display main executed commands.
34
 
35
# Copyright (c) 2007, Atmel Corporation All rights reserved.
36
#
37
# Redistribution and use in source and binary forms, with or without
38
# modification, are permitted provided that the following conditions are met:
39
#
40
# 1. Redistributions of source code must retain the above copyright notice, this
41
# list of conditions and the following disclaimer.
42
#
43
# 2. Redistributions in binary form must reproduce the above copyright notice,
44
# this list of conditions and the following disclaimer in the documentation and/
45
# or other materials provided with the distribution.
46
#
47
# 3. The name of ATMEL may not be used to endorse or promote products derived
48
# from this software without specific prior written permission.
49
#
50
# THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
51
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
52
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
53
# SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
54
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
58
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
59
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60
 
61
 
62
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
63
# ENVIRONMENT SETTINGS
64
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
65
 
66
FirstWord = $(if $(1),$(word 1,$(1)))
67
LastWord  = $(if $(1),$(word $(words $(1)),$(1)))
68
 
69
MAKE      = make
70
MAKECFG   = config.mk
71
TGTTYPE   = $(suffix $(TARGET))
72
 
73
RM        = rm -Rf
74
 
75
AR        = avr32-ar
76
ARFLAGS   = rcs
77
 
78
CPP       = $(CC) -E
79
CPPFLAGS  = -march=$(ARCH) -mpart=$(PART) $(WARNINGS) $(DEFS) \
80
            $(PLATFORM_INC_PATH:%=-I%) $(INC_PATH:%=-I%) $(CPP_EXTRA_FLAGS)
81
DPNDFILES = $(CSRCS:.c=.d) $(ASSRCS:.S=.d)
82
CPPFILES  = $(CSRCS:.c=.i)
83
 
84
CC        = avr32-gcc
85
CFLAGS    = $(DEBUG) $(OPTIMIZATION) $(C_EXTRA_FLAGS) \
86
            $(PLATFORM_INC_PATH:%=-Wa,-I%) $(INC_PATH:%=-Wa,-I%) $(AS_EXTRA_FLAGS)
87
ASFILES   = $(CSRCS:.c=.x) $(ASSRCS:.S=.x)
88
 
89
AS        = avr32-as
90
ASFLAGS   = $(DEBUG) \
91
            $(PLATFORM_INC_PATH:%=-Wa,-I%) $(INC_PATH:%=-Wa,-I%) $(AS_EXTRA_FLAGS)
92
OBJFILES  = $(CSRCS:.c=.o) $(ASSRCS:.S=.o)
93
 
94
LD        = avr32-ld
95
LDFLAGS   = -march=$(ARCH) -mpart=$(PART) \
96
            $(LIB_PATH:%=-L%) $(LINKER_SCRIPT:%=-T%) $(LD_EXTRA_FLAGS)
97
LOADLIBES =
98
LDLIBS    = $(LIBS:%=-l%)
99
 
100
OBJDUMP   = avr32-objdump
101
LSS       = $(TARGET:$(TGTTYPE)=.lss)
102
 
103
NM        = avr32-nm
104
SYM       = $(TARGET:$(TGTTYPE)=.sym)
105
 
106
OBJCOPY   = avr32-objcopy
107
HEX       = $(TARGET:$(TGTTYPE)=.hex)
108
BIN       = $(TARGET:$(TGTTYPE)=.bin)
109
 
110
SIZE      = avr32-size
111
 
112
SLEEP     = sleep
113
SLEEPUSB  = 9
114
 
115
PROGRAM   = avr32program
116
 
117
ISP       = batchisp
118
ISPFLAGS  = -device at32$(PART) -hardware usb -operation
119
 
120
DBGPROXY  = avr32gdbproxy
121
 
122
DOCGEN    = doxygen
123
 
124
 
125
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
126
# MESSAGES
127
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
128
 
129
ERR_TARGET_TYPE       = Target type not supported: `$(TGTTYPE)'
130
MSG_CLEANING          = Cleaning project.
131
MSG_PREPROCESSING     = Preprocessing \`$<\' to \`$@\'.
132
MSG_COMPILING         = Compiling \`$<\' to \`$@\'.
133
MSG_ASSEMBLING        = Assembling \`$<\' to \`$@\'.
134
MSG_ARCHIVING         = Archiving to \`$@\'.
135
MSG_LINKING           = Linking to \`$@\'.
136
MSG_EXTENDED_LISTING  = Creating extended listing to \`$@\'.
137
MSG_SYMBOL_TABLE      = Creating symbol table to \`$@\'.
138
MSG_IHEX_IMAGE        = Creating Intel HEX image to \`$@\'.
139
MSG_BINARY_IMAGE      = Creating binary image to \`$@\'.
140
MSG_GETTING_CPU_INFO  = Getting CPU information.
141
MSG_HALTING           = Stopping CPU execution.
142
MSG_ERASING_CHIP      = Performing a JTAG Chip Erase command.
143
MSG_ERASING           = Performing a flash chip erase.
144
MSG_PROGRAMMING       = Programming MCU memory from \`$(TARGET)\'.
145
MSG_SECURING_FLASH    = Protecting chip by setting security bit.
146
MSG_RESETTING         = Resetting MCU.
147
MSG_DEBUGGING         = Opening debug connection with MCU.
148
MSG_RUNNING           = Starting CPU execution.
149
MSG_READING_CPU_REGS  = Reading CPU registers.
150
MSG_CLEANING_DOC      = Cleaning documentation.
151
MSG_GENERATING_DOC    = Generating documentation to \`$(DOC_PATH)\'.
152
 
153
 
154
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
155
# MAKE RULES
156
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
157
 
158
# Include the make configuration file.
159
include $(MAKECFG)
160
 
161
# ** ** TOP-LEVEL RULES ** **
162
 
163
# Default goal: build the project.
164
ifeq ($(TGTTYPE),.a)
165
.PHONY: all
166
all: ccversion a lss sym sizes
167
else
168
ifeq ($(TGTTYPE),.elf)
169
.PHONY: all
170
all: ccversion elf lss sym hex bin sizes
171
else
172
$(error $(ERR_TARGET_TYPE))
173
endif
174
endif
175
 
176
# Clean up the project.
177
.PHONY: clean
178
clean:
179
        @echo $(MSG_CLEANING)
180
        -$(VERBOSE_CMD)$(RM) $(BIN)
181
        -$(VERBOSE_CMD)$(RM) $(HEX)
182
        -$(VERBOSE_CMD)$(RM) $(SYM)
183
        -$(VERBOSE_CMD)$(RM) $(LSS)
184
        -$(VERBOSE_CMD)$(RM) $(TARGET)
185
        -$(VERBOSE_CMD)$(RM) $(OBJFILES)
186
        -$(VERBOSE_CMD)$(RM) $(ASFILES)
187
        -$(VERBOSE_CMD)$(RM) $(CPPFILES)
188
        -$(VERBOSE_CMD)$(RM) $(DPNDFILES)
189
        $(VERBOSE_NL)
190
 
191
# Rebuild the project.
192
.PHONY: rebuild
193
rebuild: clean all
194
 
195
# Display CC version information.
196
.PHONY: ccversion
197
ccversion:
198
        @echo
199
        @echo
200
        @$(CC) --version
201
 
202
# Generate preprocessed files from C source files.
203
.PHONY: cppfiles
204
cppfiles: $(CPPFILES)
205
 
206
# Generate preprocessed assembler files from C and assembler source files.
207
.PHONY: asfiles
208
asfiles: $(ASFILES)
209
 
210
# Generate object files from C and assembler source files.
211
.PHONY: objfiles
212
objfiles: $(OBJFILES)
213
 
214
ifeq ($(TGTTYPE),.a)
215
# Archive: create A output file from object files.
216
.PHONY: a
217
a: $(TARGET)
218
else
219
ifeq ($(TGTTYPE),.elf)
220
# Link: create ELF output file from object files.
221
.PHONY: elf
222
elf: $(TARGET)
223
endif
224
endif
225
 
226
# Create extended listing from target output file.
227
.PHONY: lss
228
lss: $(LSS)
229
 
230
# Create symbol table from target output file.
231
.PHONY: sym
232
sym: $(SYM)
233
 
234
ifeq ($(TGTTYPE),.elf)
235
 
236
# Create Intel HEX image from ELF output file.
237
.PHONY: hex
238
hex: $(HEX)
239
 
240
# Create binary image from ELF output file.
241
.PHONY: bin
242
bin: $(BIN)
243
 
244
endif
245
 
246
# Display target size information.
247
.PHONY: sizes
248
sizes: $(TARGET)
249
        @echo
250
        @echo
251
ifeq ($(TGTTYPE),.a)
252
        @$(SIZE) -Bxt $<
253
else
254
ifeq ($(TGTTYPE),.elf)
255
        @$(SIZE) -Ax $<
256
        @$(SIZE) -Bx $<
257
endif
258
endif
259
        @echo
260
        @echo
261
 
262
ifeq ($(TGTTYPE),.elf)
263
 
264
# Use ISP instead of JTAGICE mkII when programming.
265
.PHONY: isp
266
ifeq ($(filter-out isp verbose,$(MAKECMDGOALS)),)
267
isp: all
268
else
269
isp:
270
        @:
271
endif
272
 
273
ifeq ($(findstring isp,$(MAKECMDGOALS)),)
274
 
275
# Get CPU information.
276
.PHONY: cpuinfo
277
cpuinfo:
278
        @echo
279
        @echo $(MSG_GETTING_CPU_INFO)
280
        $(VERBOSE_CMD)$(PROGRAM) cpuinfo
281
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),cpuinfo)
282
        @$(SLEEP) $(SLEEPUSB)
283
else
284
        @echo
285
endif
286
 
287
# Stop CPU execution.
288
.PHONY: halt
289
halt:
290
ifeq ($(filter cpuinfo chiperase erase program secureflash reset run readregs,$(MAKECMDGOALS)),)
291
        @echo
292
        @echo $(MSG_HALTING)
293
        $(VERBOSE_CMD)$(PROGRAM) halt
294
ifneq ($(call LastWord,$(filter halt debug,$(MAKECMDGOALS))),halt)
295
        @$(SLEEP) $(SLEEPUSB)
296
else
297
        @echo
298
endif
299
else
300
        @:
301
endif
302
 
303
# Perform a JTAG Chip Erase command.
304
.PHONY: chiperase
305
chiperase:
306
        @echo
307
        @echo $(MSG_ERASING_CHIP)
308
        $(VERBOSE_CMD)$(PROGRAM) chiperase
309
ifneq ($(call LastWord,$(filter cpuinfo chiperase program secureflash reset debug run readregs,$(MAKECMDGOALS))),chiperase)
310
        @$(SLEEP) $(SLEEPUSB)
311
else
312
        @echo
313
endif
314
 
315
# Perform a flash chip erase.
316
.PHONY: erase
317
erase:
318
ifeq ($(filter chiperase program,$(MAKECMDGOALS)),)
319
        @echo
320
        @echo $(MSG_ERASING)
321
        $(VERBOSE_CMD)$(PROGRAM) erase $(FLASH:%=-f%)
322
ifneq ($(call LastWord,$(filter cpuinfo erase secureflash reset debug run readregs,$(MAKECMDGOALS))),erase)
323
        @$(SLEEP) $(SLEEPUSB)
324
else
325
        @echo
326
endif
327
else
328
        @:
329
endif
330
 
331
# Program MCU memory from ELF output file.
332
.PHONY: program
333
program: all
334
        @echo
335
        @echo $(MSG_PROGRAMMING)
336
        $(VERBOSE_CMD)$(PROGRAM) program $(FLASH:%=-f%) $(PROG_CLOCK:%=-c%) -e -v -R $(if $(findstring run,$(MAKECMDGOALS)),-r) $(TARGET)
337
ifneq ($(call LastWord,$(filter cpuinfo chiperase program secureflash debug readregs,$(MAKECMDGOALS))),program)
338
        @$(SLEEP) $(SLEEPUSB)
339
else
340
        @echo
341
endif
342
 
343
# Protect chip by setting security bit.
344
.PHONY: secureflash
345
secureflash:
346
        @echo
347
        @echo $(MSG_SECURING_FLASH)
348
        $(VERBOSE_CMD)$(PROGRAM) secureflash
349
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),secureflash)
350
        @$(SLEEP) $(SLEEPUSB)
351
else
352
        @echo
353
endif
354
 
355
# Reset MCU.
356
.PHONY: reset
357
reset:
358
ifeq ($(filter program run,$(MAKECMDGOALS)),)
359
        @echo
360
        @echo $(MSG_RESETTING)
361
        $(VERBOSE_CMD)$(PROGRAM) reset
362
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase secureflash reset debug readregs,$(MAKECMDGOALS))),reset)
363
        @$(SLEEP) $(SLEEPUSB)
364
else
365
        @echo
366
endif
367
else
368
        @:
369
endif
370
 
371
# Open a debug connection with the MCU.
372
.PHONY: debug
373
debug:
374
        @echo
375
        @echo $(MSG_DEBUGGING)
376
        $(VERBOSE_CMD)$(DBGPROXY) $(FLASH:%=-f%)
377
ifneq ($(call LastWord,$(filter cpuinfo halt chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),debug)
378
        @$(SLEEP) $(SLEEPUSB)
379
else
380
        @echo
381
endif
382
 
383
# Start CPU execution.
384
.PHONY: run
385
run:
386
ifeq ($(findstring program,$(MAKECMDGOALS)),)
387
        @echo
388
        @echo $(MSG_RUNNING)
389
        $(VERBOSE_CMD)$(PROGRAM) run $(if $(findstring reset,$(MAKECMDGOALS)),-R)
390
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase secureflash debug run readregs,$(MAKECMDGOALS))),run)
391
        @$(SLEEP) $(SLEEPUSB)
392
else
393
        @echo
394
endif
395
else
396
        @:
397
endif
398
 
399
# Read CPU registers.
400
.PHONY: readregs
401
readregs:
402
        @echo
403
        @echo $(MSG_READING_CPU_REGS)
404
        $(VERBOSE_CMD)$(PROGRAM) readregs
405
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),readregs)
406
        @$(SLEEP) $(SLEEPUSB)
407
else
408
        @echo
409
endif
410
 
411
else
412
 
413
# Perform a flash chip erase.
414
.PHONY: erase
415
erase:
416
ifeq ($(findstring program,$(MAKECMDGOALS)),)
417
        @echo
418
        @echo $(MSG_ERASING)
419
        $(VERBOSE_CMD)$(ISP) $(ISPFLAGS) erase f memory flash blankcheck
420
ifeq ($(call LastWord,$(filter erase secureflash debug run,$(MAKECMDGOALS))),erase)
421
        @echo
422
endif
423
else
424
        @:
425
endif
426
 
427
# Program MCU memory from ELF output file.
428
.PHONY: program
429
program: all
430
        @echo
431
        @echo $(MSG_PROGRAMMING)
432
        $(VERBOSE_CMD)$(ISP) $(ISPFLAGS) erase f memory flash blankcheck loadbuffer $(TARGET) program verify $(if $(findstring run,$(MAKECMDGOALS)),$(if $(findstring secureflash,$(MAKECMDGOALS)),,start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0))
433
ifeq ($(call LastWord,$(filter program secureflash debug,$(MAKECMDGOALS))),program)
434
        @echo
435
endif
436
 
437
# Protect chip by setting security bit.
438
.PHONY: secureflash
439
secureflash:
440
        @echo
441
        @echo $(MSG_SECURING_FLASH)
442
        $(VERBOSE_CMD)$(ISP) $(ISPFLAGS) memory security addrange 0x0 0x0 fillbuffer 0x01 program $(if $(findstring run,$(MAKECMDGOALS)),start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0)
443
ifeq ($(call LastWord,$(filter erase program secureflash debug,$(MAKECMDGOALS))),secureflash)
444
        @echo
445
endif
446
 
447
# Reset MCU.
448
.PHONY: reset
449
reset:
450
        @:
451
 
452
# Open a debug connection with the MCU.
453
.PHONY: debug
454
debug:
455
        @echo
456
        @echo $(MSG_DEBUGGING)
457
        $(VERBOSE_CMD)$(DBGPROXY) $(FLASH:%=-f%)
458
ifeq ($(call LastWord,$(filter erase program secureflash debug run,$(MAKECMDGOALS))),debug)
459
        @echo
460
endif
461
 
462
# Start CPU execution.
463
.PHONY: run
464
run:
465
ifeq ($(filter program secureflash,$(MAKECMDGOALS)),)
466
        @echo
467
        @echo $(MSG_RUNNING)
468
        $(VERBOSE_CMD)$(ISP) $(ISPFLAGS) start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0
469
ifeq ($(call LastWord,$(filter erase debug run,$(MAKECMDGOALS))),run)
470
        @echo
471
endif
472
else
473
        @:
474
endif
475
 
476
endif
477
 
478
endif
479
 
480
# Build the documentation.
481
.PHONY: doc
482
doc:
483
        @echo
484
        @echo $(MSG_GENERATING_DOC)
485
        $(VERBOSE_CMD)cd $(dir $(DOC_CFG)) && $(DOCGEN) $(notdir $(DOC_CFG))
486
        @echo
487
 
488
# Clean up the documentation.
489
.PHONY: cleandoc
490
cleandoc:
491
        @echo $(MSG_CLEANING_DOC)
492
        -$(VERBOSE_CMD)$(RM) $(DOC_PATH)
493
        $(VERBOSE_NL)
494
 
495
# Rebuild the documentation.
496
.PHONY: rebuilddoc
497
rebuilddoc: cleandoc doc
498
 
499
# Display main executed commands.
500
.PHONY: verbose
501
ifeq ($(filter-out isp verbose,$(MAKECMDGOALS)),)
502
verbose: all
503
else
504
verbose:
505
        @:
506
endif
507
ifneq ($(findstring verbose,$(MAKECMDGOALS)),)
508
# Prefix displaying the following command if and only if verbose is a goal.
509
VERBOSE_CMD =
510
# New line displayed if and only if verbose is a goal.
511
VERBOSE_NL  = @echo
512
else
513
VERBOSE_CMD = @
514
VERBOSE_NL  =
515
endif
516
 
517
# ** ** COMPILATION RULES ** **
518
 
519
# Include silently the dependency files.
520
-include $(DPNDFILES)
521
 
522
# The dependency files are not built alone but along with first generation files.
523
$(DPNDFILES):
524
 
525
# First generation files depend on make files.
526
$(CPPFILES) $(ASFILES) $(OBJFILES): Makefile $(MAKECFG)
527
 
528
ifeq ($(TGTTYPE),.elf)
529
# Files resulting from linking depend on linker script.
530
$(TARGET): $(LINKER_SCRIPT)
531
endif
532
 
533
# Preprocess: create preprocessed files from C source files.
534
%.i: %.c %.d
535
        @echo $(MSG_PREPROCESSING)
536
        $(VERBOSE_CMD)$(CPP) $(CPPFLAGS) -MD -MP -MT '$*.i $*.x $*.o' -o $@ $<
537
        @touch $*.d
538
        @touch $@
539
        $(VERBOSE_NL)
540
 
541
# Preprocess & compile: create assembler files from C source files.
542
%.x: %.c %.d
543
        @echo $(MSG_COMPILING)
544
        $(VERBOSE_CMD)$(CC) -S $(CPPFLAGS) -MD -MP -MT '$*.i $*.o' $(CFLAGS) -o $@ $<
545
        @touch $*.d
546
        @touch $@
547
        $(VERBOSE_NL)
548
 
549
# Preprocess: create preprocessed files from assembler source files.
550
%.x: %.S %.d
551
        @echo $(MSG_PREPROCESSING)
552
        $(VERBOSE_CMD)$(CPP) $(CPPFLAGS) -MD -MP -MT '$*.x $*.o' -o $@ $<
553
        @touch $*.d
554
        @touch $@
555
        $(VERBOSE_NL)
556
 
557
# Preprocess, compile & assemble: create object files from C source files.
558
%.o: %.c %.d
559
        @echo $(MSG_COMPILING)
560
        $(VERBOSE_CMD)$(CC) -c $(CPPFLAGS) -MD -MP -MT '$*.i $*.x' $(CFLAGS) -o $@ $<
561
        @touch $*.d
562
        @touch $@
563
        $(VERBOSE_NL)
564
 
565
# Preprocess & assemble: create object files from assembler source files.
566
%.o: %.S %.d
567
        @echo $(MSG_ASSEMBLING)
568
        $(VERBOSE_CMD)$(CC) -c $(CPPFLAGS) -MD -MP -MT '$*.x' $(ASFLAGS) -o $@ $<
569
        @touch $*.d
570
        @touch $@
571
        $(VERBOSE_NL)
572
 
573
.PRECIOUS: $(OBJFILES)
574
ifeq ($(TGTTYPE),.a)
575
# Archive: create A output file from object files.
576
.SECONDARY: $(TARGET)
577
$(TARGET): $(OBJFILES)
578
        @echo $(MSG_ARCHIVING)
579
        $(VERBOSE_CMD)$(AR) $(ARFLAGS) $@ $(filter %.o,$+)
580
        $(VERBOSE_NL)
581
else
582
ifeq ($(TGTTYPE),.elf)
583
# Link: create ELF output file from object files.
584
.SECONDARY: $(TARGET)
585
$(TARGET): $(OBJFILES)
586
        @echo $(MSG_LINKING)
587
        $(VERBOSE_CMD)$(CC) $(LDFLAGS) $(filter %.o,$+) $(LOADLIBES) $(LDLIBS) -o $@
588
        $(VERBOSE_NL)
589
endif
590
endif
591
 
592
# Create extended listing from target output file.
593
$(LSS): $(TARGET)
594
        @echo $(MSG_EXTENDED_LISTING)
595
        $(VERBOSE_CMD)$(OBJDUMP) -h -S $< > $@
596
        $(VERBOSE_NL)
597
 
598
# Create symbol table from target output file.
599
$(SYM): $(TARGET)
600
        @echo $(MSG_SYMBOL_TABLE)
601
        $(VERBOSE_CMD)$(NM) -n $< > $@
602
        $(VERBOSE_NL)
603
 
604
ifeq ($(TGTTYPE),.elf)
605
 
606
# Create Intel HEX image from ELF output file.
607
$(HEX): $(TARGET)
608
        @echo $(MSG_IHEX_IMAGE)
609
        $(VERBOSE_CMD)$(OBJCOPY) -O ihex $< $@
610
        $(VERBOSE_NL)
611
 
612
# Create binary image from ELF output file.
613
$(BIN): $(TARGET)
614
        @echo $(MSG_BINARY_IMAGE)
615
        $(VERBOSE_CMD)$(OBJCOPY) -O binary $< $@
616
        $(VERBOSE_NL)
617
 
618
endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.