-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
126 lines (109 loc) · 2.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
PROJECT=uip_demo.elf
PROJECT_MAP=$(PROJECT:.elf=.map)
PROJECT_LST=$(PROJECT:.elf=.lst)
PROJECT_HEX=$(PROJECT:.elf=.hex)
CC=rx-elf-gcc
AS=rx-elf-gcc
LD=rx-elf-gcc
SIZE=rx-elf-size
OBJDUMP=rx-elf-objdump
OBJCOPY=rx-elf-objcopy
FLASH_TOOL=rxusb
# -Wredundant-decls \
# -Wshadow \
CFLAGS=\
-I. \
-Ibsp \
-Idriver \
-Iuip \
-Iuip/uip \
-Iuip/lib \
-Iuip/yrdkrx62n \
-Iuip/apps/dhcpc \
-Iuip/apps/webserver \
-Iuser-app \
-O2 \
-g2 \
-Wall \
-Wextra \
-Wnested-externs \
-Wpointer-arith \
-Wswitch \
-Wreturn-type \
-Wstrict-prototypes \
-Wunused \
-Wno-main \
\
-Wno-strict-aliasing \
-Wno-unused-but-set-variable \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wno-sign-compare \
\
-MMD \
-mlittle-endian-data \
-mint-register=0 \
-ffunction-sections \
-fdata-sections \
-std=gnu99 \
$(END)
ASFLAGS=\
$(END)
LDFLAGS=\
-nostartfiles \
-Wl,--gc-sections \
-Wl,-Map=$(PROJECT_MAP) \
-T bsp/RX62N8.ld \
$(END)
SRC=\
driver/phy.c \
driver/r_ether.c \
uip/apps/dhcpc/dhcpc.c \
uip/apps/webserver/http-strings.c \
uip/apps/webserver/httpd-cgi.c \
uip/apps/webserver/httpd-fs.c \
uip/apps/webserver/httpd.c \
uip/uip/psock.c \
uip/uip/timer.c \
uip/uip/uip-fw.c \
uip/uip/uip-neighbor.c \
uip/uip/uip-split.c \
uip/uip/uip.c \
uip/uip/uip_arp.c \
uip/uip/uiplib.c \
uip/yrdkrx62n/clock-arch.c \
uip/yrdkrx62n/main.c \
user-app/user-app.c \
bsp/isr_vectors.c \
bsp/hwsetup.c \
bsp/font_x5x7.c \
bsp/lcd.c \
$(END)
OBJ=$(SRC:.c=.o) bsp/crt0.o
DEP=$(OBJ:.o=.d)
all: $(PROJECT)
$(PROJECT): $(OBJ)
@echo -e "\tLD\t"$@
@$(LD) $(LDFLAGS) -o $@ $^
@echo -e "\tSIZE\t"$@
@$(SIZE) $@
%.o: %.c
@echo -e "\tCC\t"$@
@$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.S
@echo -e "\tAS\t"$@
@$(AS) $(ASFLAGS) -c -o $@ $<
%.lst: %.elf
@echo -e "\tOBJDUMP\t"$@
@$(OBJDUMP) -DS $^ > $@
%.lst: %.o
@echo -e "\tOBJDUMP\t"$@
@$(OBJDUMP) -DS $^ > $@
%.hex: %.elf
@echo -e "\tOBJCOPY\t"$@
@$(OBJCOPY) -Oihex $^ $@
flash: $(PROJECT)
@$(FLASH_TOOL) -v $<
clean:
@rm -f $(OBJ) $(DEP) $(PROJECT) $(PROJECT_MAP) $(PROJECT_LST) $(PROJECT_HEX)
-include $(DEP)