1
|
# FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.
|
2
|
#
|
3
|
# This file is part of the FreeRTOS.org distribution.
|
4
|
#
|
5
|
# FreeRTOS.org is free software; you can redistribute it and/or modify
|
6
|
# it under the terms of the GNU General Public License as published by
|
7
|
# the Free Software Foundation; either version 2 of the License, or
|
8
|
# (at your option) any later version.
|
9
|
#
|
10
|
# FreeRTOS.org is distributed in the hope that it will be useful,
|
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
# GNU General Public License for more details.
|
14
|
#
|
15
|
# You should have received a copy of the GNU General Public License
|
16
|
# along with FreeRTOS.org; if not, write to the Free Software
|
17
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
18
|
#
|
19
|
# A special exception to the GPL can be applied should you wish to distribute
|
20
|
# a combined work that includes FreeRTOS.org, without being obliged to provide
|
21
|
# the source code for any proprietary components. See the licensing section
|
22
|
# of http://www.FreeRTOS.org for full details of how and when the exception
|
23
|
# can be applied.
|
24
|
#
|
25
|
# ***************************************************************************
|
26
|
# See http://www.FreeRTOS.org for documentation, latest information, license
|
27
|
# and contact details. Please ensure to read the configuration and relevant
|
28
|
# port sections of the online documentation.
|
29
|
# ***************************************************************************
|
30
|
|
31
|
CC=arm-elf-gcc
|
32
|
OBJCOPY=arm-elf-objcopy
|
33
|
OBJDUMP=arm-elf-objdump
|
34
|
ARCH=arm-elf-ar
|
35
|
CRT0=os/boot/boot.s
|
36
|
DEBUG=-g
|
37
|
OPTIM=-O2
|
38
|
LDSCRIPT=config/atmel-rom.ld
|
39
|
ARCH=AT91SAM7S256
|
40
|
|
41
|
# Automatic dependency generation as per http://make.paulandlesley.org/autodep.html
|
42
|
DEPDIR = .deps
|
43
|
df = $(DEPDIR)/$(*F)
|
44
|
|
45
|
#
|
46
|
# CFLAGS common to both the THUMB and ARM mode builds
|
47
|
#
|
48
|
|
49
|
CFLAGS= \
|
50
|
-D __$(ARCH)__ \
|
51
|
-Iconfig \
|
52
|
-Iapplication \
|
53
|
-Ios/core/include \
|
54
|
-Ios/usb \
|
55
|
-Ios/core/ARM7_AT91SAM7S \
|
56
|
-Wall \
|
57
|
-Werror \
|
58
|
-Wextra \
|
59
|
-Wno-multichar \
|
60
|
-Wstrict-prototypes \
|
61
|
-Wno-strict-aliasing \
|
62
|
-D SAM7_GCC \
|
63
|
-mcpu=arm7tdmi \
|
64
|
-ffunction-sections \
|
65
|
-fdata-sections \
|
66
|
-T$(LDSCRIPT) \
|
67
|
$(DEBUG) \
|
68
|
$(OPTIM) \
|
69
|
-fomit-frame-pointer \
|
70
|
-MD
|
71
|
|
72
|
LINKER_FLAGS=-Xlinker -oopenpicc.elf -Xlinker -M -Xlinker -Map=openpicc.map
|
73
|
|
74
|
#
|
75
|
# Source files that must be built to ARM mode.
|
76
|
#
|
77
|
ARM_SRC= \
|
78
|
config/board.c \
|
79
|
application/main.c \
|
80
|
application/led.c \
|
81
|
application/cmd.c \
|
82
|
application/env.c \
|
83
|
application/da.c \
|
84
|
application/adc.c \
|
85
|
application/pll.c \
|
86
|
application/pio_irq.c \
|
87
|
application/ssc.c \
|
88
|
application/tc_cdiv_sync.c \
|
89
|
application/tc_fdt.c \
|
90
|
application/tc_cdiv.c \
|
91
|
application/tc_recv.c \
|
92
|
application/usb_print.c \
|
93
|
application/iso14443_layer2a.c \
|
94
|
application/iso14443a_manchester.c \
|
95
|
application/iso14443a_miller.c \
|
96
|
application/iso14443a_diffmiller.c \
|
97
|
application/load_modulation.c \
|
98
|
application/clock_switch.c \
|
99
|
application/decoder_miller.c \
|
100
|
application/decoder_nrzl.c \
|
101
|
application/decoder.c \
|
102
|
application/performance.c \
|
103
|
os/boot/Cstartup_SAM7.c \
|
104
|
os/core/list.c \
|
105
|
os/core/queue.c \
|
106
|
os/core/tasks.c \
|
107
|
os/core/ARM7_AT91SAM7S/lib_AT91SAM7.c \
|
108
|
os/core/ARM7_AT91SAM7S/port.c \
|
109
|
os/core/ARM7_AT91SAM7S/portISR.c \
|
110
|
os/core/MemMang/heap_2.c \
|
111
|
os/usb/USB-CDC.c \
|
112
|
os/usb/USBIsr.c \
|
113
|
application/iso14443a_pretender.c \
|
114
|
# application/iso14443_sniffer.c \
|
115
|
# application/tc_sniffer.c \
|
116
|
# application/iso14443_layer3a.c
|
117
|
|
118
|
#
|
119
|
# Define all object files.
|
120
|
#
|
121
|
ARM_OBJ = $(ARM_SRC:.c=.o)
|
122
|
FREERTOS_THUMB_OBJ = $(FREERTOS_THUMB_SRC:.c=.o)
|
123
|
DEMO_APP_THMUB_OBJ = $(DEMO_APP_THMUB_SRC:.c=.o)
|
124
|
|
125
|
all: old-size openpicc.bin print-size
|
126
|
|
127
|
openpicc.bin : openpicc.elf
|
128
|
$(OBJCOPY) openpicc.elf -O binary openpicc.bin
|
129
|
|
130
|
openpicc.hex : openpicc.elf
|
131
|
$(OBJCOPY) openpicc.elf -O ihex openpicc.hex
|
132
|
|
133
|
openpicc.elf : $(ARM_OBJ) $(DEMO_APP_THMUB_OBJ) $(FREERTOS_THUMB_OBJ) $(CRT0) Makefile config/FreeRTOSConfig.h
|
134
|
$(CC) $(CFLAGS) $(ARM_OBJ) $(DEMO_APP_THMUB_OBJ) $(FREERTOS_THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
|
135
|
$(OBJDUMP) -d openpicc.elf > openpicc.asm
|
136
|
|
137
|
$(DEMO_APP_THMUB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h
|
138
|
$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
|
139
|
|
140
|
$(FREERTOS_THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h
|
141
|
$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
|
142
|
|
143
|
$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile config/FreeRTOSConfig.h config/board.h
|
144
|
$(CC) -c $(CFLAGS) $< -o $@
|
145
|
@mkdir -p $(DEPDIR); cp $*.d $(df).P; \
|
146
|
rm -f $*.d
|
147
|
|
148
|
clean :
|
149
|
touch Makefile
|
150
|
find -name '*.o' -exec rm \{\} \;
|
151
|
rm -f openpicc.bin openpicc.elf openpicc.map openpicc.asm config/compile.h
|
152
|
rm -rf $(DEPDIR)
|
153
|
rm -f old-size new-size
|
154
|
|
155
|
.PHONY: config/compile.h print-size old-size all
|
156
|
config/compile.h:
|
157
|
scripts/mkcompile_h > config/compile.h
|
158
|
application/cmd.o: config/compile.h
|
159
|
|
160
|
old-size:
|
161
|
arm-elf-size -B openpicc.elf > old-size || true
|
162
|
|
163
|
print-size: openpicc.elf
|
164
|
arm-elf-size -B $< > new-size
|
165
|
((diff -u old-size new-size 2> /dev/null && cat new-size) || true) | egrep "(text|elf)"
|
166
|
|
167
|
-include $(DEPDIR)/*.P
|