1 |
583 |
jeremybenn |
#
|
2 |
|
|
# FreeRTOS 4.1.0 - MCF5235 Coldfire Port
|
3 |
|
|
#
|
4 |
|
|
# Copyright (c) 2006 Christian Walter, Vienna 2006.
|
5 |
|
|
#
|
6 |
|
|
# $Id: Makefile 2 2011-07-17 20:13:17Z filepang@gmail.com $
|
7 |
|
|
#
|
8 |
|
|
# ---------------------------------------------------------------------------
|
9 |
|
|
BASE = /opt/gcc-m68k/bin
|
10 |
|
|
CC = $(BASE)/m68k-elf-gcc
|
11 |
|
|
CXX = $(BASE)/m68k-elf-g++
|
12 |
|
|
OBJCOPY = $(BASE)/m68k-elf-objcopy
|
13 |
|
|
SIZE = $(BASE)/m68k-elf-size
|
14 |
|
|
INSIGHT = $(BASE)/m68k-bdm-elf-insight
|
15 |
|
|
BDMFLASH = $(BASE)/bdmflash
|
16 |
|
|
|
17 |
|
|
#CFLAGS = -MD -gdwarf-2 -g3 -m528x -Wall
|
18 |
|
|
CFLAGS = -MD -O2 -m528x -Wall \
|
19 |
|
|
-D'GCC_MCF5235=1' -D'_GCC_USES_FP=1' \
|
20 |
|
|
-D'__IPSBAR=((vuint8 *) 0x40000000)' -D'FSYS_2=25000000UL' \
|
21 |
|
|
-I. -Iinclude -Iinclude/arch -Ifec \
|
22 |
|
|
-I../../Source/include -I../Common/include \
|
23 |
|
|
-Ilwip/src/include -Ilwip/src/include/ipv4 \
|
24 |
|
|
-Ilwip/contrib/port/FreeRTOS/MCF5235 \
|
25 |
|
|
-Ilwip/contrib/port/FreeRTOS/MCF5235/netif
|
26 |
|
|
|
27 |
|
|
ASFLAGS = -MD -gdwarf-2 -g3 -m528x -Wa,--register-prefix-optional \
|
28 |
|
|
-Wa,--bitwise-or -Wa,--defsym,IPSBAR=0x40000000
|
29 |
|
|
LDSCRIPT = m5235-ram.ld
|
30 |
|
|
LDFLAGS = -nostartfiles -m528x -Wl,--script=$(LDSCRIPT)
|
31 |
|
|
|
32 |
|
|
TGT = demo
|
33 |
|
|
OTHER_CSRC =
|
34 |
|
|
OTHER_ASRC = $(addprefix system/, crt0.S vector.S)
|
35 |
|
|
CSRC = demo.c web.c \
|
36 |
|
|
$(addprefix system/, init.c newlib.c serial.c) \
|
37 |
|
|
$(addprefix ../Common/Minimal/, PollQ.c integer.c flop.c BlockQ.c semtest.c dynamic.c ) \
|
38 |
|
|
$(addprefix ../../Source/, tasks.c queue.c list.c) \
|
39 |
|
|
$(addprefix ../../Source/portable/MemMang/, heap_3.c) \
|
40 |
|
|
$(addprefix ../../Source/portable/GCC/MCF5235/, port.c) \
|
41 |
|
|
$(addprefix lwip/src/core/, tcp_out.c inet.c mem.c memp.c netif.c pbuf.c raw.c stats.c sys.c tcp.c tcp_in.c udp.c ipv4/ip.c ipv4/ip_addr.c ipv4/icmp.c ipv4/ip_frag.c) \
|
42 |
|
|
$(addprefix lwip/src/api/, tcpip.c api_msg.c err.c api_lib.c ) \
|
43 |
|
|
$(addprefix lwip/src/netif/, etharp.c ) \
|
44 |
|
|
$(addprefix lwip/contrib/port/FreeRTOS/MCF5235/, sys_arch.c netif/fec.c netif/nbuf.c)
|
45 |
|
|
|
46 |
|
|
ASRC = $(addprefix system/, mcf5xxx.S )
|
47 |
|
|
OBJS = $(CSRC:.c=.o) $(ASRC:.S=.o)
|
48 |
|
|
NOLINK_OBJS = $(OTHER_CSRC:.c=.o) $(OTHER_ASRC:.S=.o)
|
49 |
|
|
DEPS = $(OBJS:.o=.d) $(NOLINK_OBJS:.o=.d)
|
50 |
|
|
BIN = $(TGT).elf
|
51 |
|
|
|
52 |
|
|
.PHONY: clean all
|
53 |
|
|
|
54 |
|
|
all: $(BIN)
|
55 |
|
|
|
56 |
|
|
flash-programm: $(TGT).elf
|
57 |
|
|
$(OBJCOPY) -O binary $(TGT).elf $(TGT).bin
|
58 |
|
|
@BIN_SIZE=`du -b $(TGT).bin | awk '//{ print $$1; }'`; \
|
59 |
|
|
echo "programming $(TGT).bin with size $$BIN_SIZE to flash..."; \
|
60 |
|
|
$(BDMFLASH) /dev/bdmcf20 0x00000000 1 2 write $(TGT).bin 0
|
61 |
|
|
|
62 |
|
|
flash-verify:
|
63 |
|
|
@BIN_SIZE=`du -b $(TGT).bin | awk '//{ print $$1; }'`; \
|
64 |
|
|
echo "loading $$BIN_SIZE bytes from target into $(TGT).vrf..."; \
|
65 |
|
|
$(BDMFLASH) /dev/bdmcf20 0x00000000 1 2 read $(TGT).vrf 0 $$BIN_SIZE
|
66 |
|
|
|
67 |
|
|
flash-erase:
|
68 |
|
|
$(BDMFLASH) /dev/bdmcf20 0x00000000 1 2 erase
|
69 |
|
|
|
70 |
|
|
debug:
|
71 |
|
|
$(INSIGHT) --command=m5235.gdb --se=$(TGT).elf
|
72 |
|
|
|
73 |
|
|
$(BIN): $(OBJS) $(NOLINK_OBJS)
|
74 |
|
|
$(CC) $(LDFLAGS) -Wl,-Map=$(TGT).map $(OBJS) $(LDLIBS) -o $@
|
75 |
|
|
|
76 |
|
|
clean:
|
77 |
|
|
rm -f $(DEPS)
|
78 |
|
|
rm -f $(OBJS) $(NOLINK_OBJS)
|
79 |
|
|
rm -f $(BIN) $(TGT).map
|
80 |
|
|
|
81 |
|
|
# ---------------------------------------------------------------------------
|
82 |
|
|
# rules for code generation
|
83 |
|
|
# ---------------------------------------------------------------------------
|
84 |
|
|
%.o: %.c
|
85 |
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
86 |
|
|
|
87 |
|
|
%.o: %.S
|
88 |
|
|
$(CC) $(ASFLAGS) -o $@ -c $<
|
89 |
|
|
|
90 |
|
|
# ---------------------------------------------------------------------------
|
91 |
|
|
# # compiler generated dependencies
|
92 |
|
|
# ---------------------------------------------------------------------------
|
93 |
|
|
-include $(DEPS)
|
94 |
|
|
|