-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·129 lines (100 loc) · 3.04 KB
/
Makefile
File metadata and controls
executable file
·129 lines (100 loc) · 3.04 KB
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
127
128
129
PART = LM3S9B96
ROOT = ../../StellarisWare
PREFIX = arm-none-eabi
OPT = -O2 -g
CC = ${PREFIX}-gcc
AFLAGS = -mthumb \
-mcpu=cortex-m3 \
-MD \
-I$(ROOT)
CFLAGS = -mthumb \
-mcpu=cortex-m3 \
$(OPT) \
-ffunction-sections \
-fdata-sections \
-MD \
-std=c99 \
-Wall \
-pedantic \
-DPART_${PART} \
-I$(ROOT) \
-DTARGET_IS_TEMPEST_RB1 \
-DUART_BUFFERED \
-c
AR=${PREFIX}-ar
LD=${PREFIX}-ld
OBJDUMP=${PREFIX}-objdump
OBJCOPY=${PREFIX}-objcopy
LDFLAGS=--gc-sections
LIBGCC=${shell ${CC} ${CFLAGS} -print-file-name=libgcc.a}
LIBC=${shell ${CC} ${CFLAGS} -print-file-name=libc.a}
LIBM=${shell ${CC} ${CFLAGS} -print-file-name=libm.a}
LIBI=${shell ${CC} ${CFLAGS} -print-file-name=libiberty.a}
Debug: all
cleanDebug: clean
Release: all
cleanRelease: clean
#
# Where to find source files that do not live in this directory.
#
VPATH += ${ROOT}/third_party/lwip-1.3.2/apps/httpserver_raw
VPATH += ${ROOT}/utils
#
# Where to find header files that do not live in the source directory.
#
IPATH+=.
IPATH+=${ROOT}/third_party/lwip-1.3.2/apps
IPATH+=${ROOT}/third_party/lwip-1.3.2/ports/stellaris/include
IPATH+=${ROOT}/third_party/lwip-1.3.2/src/include
IPATH+=${ROOT}/third_party/lwip-1.3.2/src/include/ipv4
IPATH+=${ROOT}/third_party
AFLAGS+=${patsubst %,-I%,${subst :, ,${IPATH}}}
CFLAGS+=${patsubst %,-I%,${subst :, ,${IPATH}}}
TARGET=rollo
LDFILE=${TARGET}.ld
debug: gcc/${TARGET}.axf
arm-none-eabi-gdbtui -x init.gdb gcc/${TARGET}.axf
debugc: gcc/${TARGET}.axf
arm-none-eabi-gdb --command=init.gdb gcc/${TARGET}.axf
serial:
picocom -b 115200 -f n -d 8 -p n /dev/cu.usbserial-0B010169B
io_fsdata.h: ${wildcard fs/*}
${ROOT}/tools/makefsfile/makefsfile.exe -i fs -o io_fsdata.h -r -h
all: gcc
all: gcc/${TARGET}.axf
all: gcc/${TARGET}.lst
clean:
@rm -rf gcc ${wildcard *~}
gcc:
@mkdir gcc
OBJ = startup_gcc.o main.o rollo.o lmi_fs.o uartstdio.o
OBJ += httpd.o locator.o lwiplib.o ustdlib.o
GOBJ = $(patsubst %.o,gcc/%.o,$(OBJ))
gcc/${TARGET}.axf: $(GOBJ)
gcc/${TARGET}.axf: ${ROOT}/driverlib/gcc/libdriver.a
gcc/${TARGET}.axf: ${TARGET}.ld
LDFILE=${TARGET}.ld
ENTRY=ResetISR
DEBUG=1
ifdef DEBUG
CFLAGS+=-g -DDEBUG
endif
gcc/%.o: %.c
@echo " compile ${<}"
@${CC} ${CFLAGS} -Dgcc -o ${@} ${<}
gcc/%.o: %.S
@echo " assemble ${<}"
@${CC} ${AFLAGS} -Dgcc -o ${@} -c ${<}
gcc/%.axf:
@echo " link ${@}"
@${LD} --entry ${ENTRY} -T${LDFILE} \
${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \
'${LIBC}' '${LIBGCC}'
@echo " binary ${@:.axf=.bin}"
@${OBJCOPY} -O binary ${@} ${@:.axf=.bin}
gcc/${TARGET}.lst: gcc/${TARGET}.axf
@echo " listing $@"
@$(OBJDUMP) -h -S $< > $@
ifneq (${MAKECMDGOALS},clean)
-include ${wildcard ${COMPILER}/*.d} __dummy__
endif