-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
42 lines (34 loc) · 1.22 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
PREFIX = /opt/riscv32i/bin/riscv32-unknown-elf-
ARCH = rv32i
ABI = ilp32
CC = $(PREFIX)gcc
CFLAGS = --std=gnu99 -Os -MD -Wall -march=$(ARCH) -mabi=$(ABI) -Iinclude -Ifs/fatfs -I../common -DLIX
LDSCRIPT = ../common/riscv-psram-lix.ld
LIBS = -lm -lgcc
OBJS = lix.o ll.o sh.o xfer.o te.o term.o zucker.o \
fs/fs.o fs/fatfs/sdmm.o fs/fatfs/ff.o
lix: lix.elf lix.bin
lix.o:
xxd -i ll_stdlib.l > include/ll_stdlib.h
$(CC) $(CFLAGS) -c ../common/zucker.c -o zucker.o
$(CC) $(CFLAGS) -c lix.c -o lix.o
$(CC) $(CFLAGS) -c ll.c -o ll.o
$(CC) $(CFLAGS) -c sh.c -o sh.o
$(CC) $(CFLAGS) -c xfer.c -o xfer.o
$(CC) $(CFLAGS) -c te.c -o te.o
$(CC) $(CFLAGS) -c term.c -o term.o
$(CC) $(CFLAGS) -c fs/fs.c -o fs/fs.o
$(CC) $(CFLAGS) -c fs/fatfs/sdmm.c -o fs/fatfs/sdmm.o
$(CC) $(CFLAGS) -c fs/fatfs/ff.c -o fs/fatfs/ff.o
$(CC) $(CFLAGS) -c fs/fs.c -o fs/fs.o
#$(CC) $(CFLAGS) -c lix.c -S -o lix.asm
lix.elf: $(OBJS)
$(CC) -Wl,-T$(LDSCRIPT),-Map,lix.map -o lix.elf $(OBJS) $(LIBS)
$(PREFIX)objdump -S --disassemble lix.elf > lix.dasm
lix.bin:
$(PREFIX)objcopy -O binary lix.elf lix.bin
te_unix:
gcc -o te te.c -lcurses -DMAIN -DCURSES
clean:
rm -f lix.elf lix.bin lix.asm lix.dasm lix.map *.d fs/*.d fs/fatfs/*.d $(OBJS)
.PHONY: lix clean