-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (46 loc) · 1.96 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
CC = ../machikania/origdev/pic32/compiler/pic32-tools/bin/pic32-gcc
CFLAGS = -Os -Wall -DMIPS -DNO_ANNOTATIONS \
-DNO_PPACK -D_RETROBSD -D__SMALLER_C_SCHAR__ \
-D__SMALLER_C__ -D__SMALLER_C_32__ -DSTATIC \
-DNO_EXTRA_WARNS -DSYNTAX_STACK_MAX=3200 -mips16 -minterlink-compressed
LD = ../machikania/origdev/pic32/compiler/pic32-tools/bin/pic32-gcc
# For cross compile
#include $(TOPSRC)/cross.mk
#CFLAGS = -Os -Wall -DMIPS -m32
#LDFLAGS = -m32
ARCH = mips
OBJS = smlrc.o ff.o NVMem.o ff_wrap.o lb.o xprintf.o main.o exception.o ps2keyboard.o videoout.o textvideolib.o as.o ld.o umm_info.o umm_integrity.o umm_malloc.o umm_poison.o aoutloader.o keyinput.o function_table.o cc.o autocomplete.o graphvideolib.o\
sd.o\
flash.o
CFLAGS += -mprocessor=32MX270F256B -g
LDFLAGS = -mprocessor=32MX270F256B -g -Wl,--defsym,_min_heap_size=0,--defsym=_min_stack_size=0,--gc-sections,--report-mem,-Map=filename.map
SIZE = xc32-size
BIN2HEX = xc32-bin2hex
all: smlrc
smlrc: $(OBJS)
${LD} ${LDFLAGS} -o $@.elf ${OBJS} ${LIBS} crt0.S crtn.S crti.S -T App_32MX170F256B.ld -nostartfiles -Os
${SIZE} $@.elf
${SIZE} *.o
xc32-objdump smlrc.elf -S -l -s> $@.asm
# ${OBJDUMP} -S $@.elf > $@.dis
${BIN2HEX} $@.elf
cp smlrc.hex /media/*/*/
clean:
rm -f $(OBJS) smlrc smlrc.dis smlrc.elf
###
smlrc.o: smlrc.c fp.c cgmips.c
${CC} ${CFLAGS} smlrc.c -g -c -o $@
# doesn't stable when compile with optimize level `-O1`, `-Os`
as.o:as.c
${CC} as.c -g -mips16 -c -o $@
aoutloader.o:aoutloader.c
${CC} aoutloader.c -g -c -Os -o $@
main.o:main.c
${CC} -mprocessor=32MX250F128B -g main.c -g -c -Os -o $@
flash.o: makefat/fatsrc/ flash.c
./makefat/a.out ./makefat/fatsrc
${CC} ${CFLAGS} flash.c -c -o $@
sd.o:sd.c
$(CC) -mprocessor=32MX250F128B -O2 sd.c -c -g -o $@
exception.o:exception.c
${CC} -g -mprocessor=32MX250F128B exception.c -minterlink-compressed -O1 -c -o $@