File tree 13 files changed +689
-3
lines changed
13 files changed +689
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ CC = ${RISCV_TOOLCHAIN_PATH}${RISCV_TOOLCHAIN_PREFIX}gcc
11
11
RISCV_CC_OPT ?= -march=rv32i -mabi=ilp32
12
12
13
13
FAT32_SOURCE = ../lib/fat/fat_access.c ../lib/fat/fat_cache.c ../lib/fat/fat_filelib.c ../lib/fat/fat_format.c ../lib/fat/fat_misc.c ../lib/fat/fat_string.c ../lib/fat/fat_table.c ../lib/fat/fat_write.c
14
- LIB_SOURCE = ../lib/io.c ../lib/syscalls.c ../lib/SDL2/sdl.c ../lib/sd_card.c $(FAT32_SOURCE ) ../lib/libfixmath/*.c ../lib/upng/*.c
14
+ LIB_SOURCE = ../lib/io.c ../lib/syscalls.c ../lib/array.c ../lib/ SDL2/sdl.c ../lib/sd_card.c $(FAT32_SOURCE ) ../lib/libfixmath/*.c ../lib/upng/*.c
15
15
PROGRAM_SOURCE = src/start.S src/*.c
16
16
SERIAL ?= /dev/tty.usbserial-D00039
17
17
Original file line number Diff line number Diff line change 7
7
#include <fat_filelib.h>
8
8
#include <libfixmath/fix16.h>
9
9
10
- #include " upng.h"
10
+ #include < upng.h>
11
11
#include "array.h"
12
12
#include "clipping.h"
13
13
#include "display.h"
Original file line number Diff line number Diff line change 5
5
6
6
#include "vector.h"
7
7
#include "texture.h"
8
- #include " upng.h"
8
+ #include < upng.h>
9
9
10
10
typedef struct {
11
11
int a ;
Original file line number Diff line number Diff line change
1
+ * .bin
2
+ * .elf
3
+ * .hex
4
+ * .lst
Original file line number Diff line number Diff line change
1
+ IVERILOG = iverilog
2
+ PYTHON = python3
3
+
4
+ RISCV_TOOLCHAIN_PATH =
5
+ RISCV_TOOLCHAIN_PREFIX = riscv-none-elf-
6
+
7
+ AS = ${RISCV_TOOLCHAIN_PATH}${RISCV_TOOLCHAIN_PREFIX}as
8
+ OBJCOPY = ${RISCV_TOOLCHAIN_PATH}${RISCV_TOOLCHAIN_PREFIX}objcopy
9
+ OBJDUMP = ${RISCV_TOOLCHAIN_PATH}${RISCV_TOOLCHAIN_PREFIX}objdump
10
+ CC = ${RISCV_TOOLCHAIN_PATH}${RISCV_TOOLCHAIN_PREFIX}gcc
11
+ RISCV_CC_OPT ?= -march=rv32i -mabi=ilp32
12
+
13
+ FAT32_SOURCE = ../lib/fat/fat_access.c ../lib/fat/fat_cache.c ../lib/fat/fat_filelib.c ../lib/fat/fat_format.c ../lib/fat/fat_misc.c ../lib/fat/fat_string.c ../lib/fat/fat_table.c ../lib/fat/fat_write.c
14
+ LIB_SOURCE = $(FAT32_SOURCE ) ../lib/io.c ../lib/syscalls.c ../lib/sd_card.c ../lib/upng/upng.c ../lib/array.c
15
+ PROGRAM_SOURCE = start.S program.c ../../../../common/graphite.c ../../../../common/cube.c ../../../../common/teapot.c ../../../../common/tex32x32.c ../../../../common/tex64x64.c
16
+ SERIAL ?= /dev/tty.usbserial-D00039
17
+
18
+ LDFILE ?= program.ld
19
+
20
+ EXTRA_CC_ARGS = -DRV_FIXED_POINT_EXTENSION=1
21
+
22
+ all : program.hex
23
+
24
+ clean :
25
+ rm -f * .hex * .elf * .bin * .lst
26
+
27
+ run : program.hex
28
+ $(PYTHON ) ../../../../utils/sendhex.py $(SERIAL ) program.hex
29
+
30
+ program.lst : program.elf
31
+ ${OBJDUMP} --disassemble program.elf > program.lst
32
+
33
+ program.hex : program.bin
34
+ ${PYTHON} ../../../../utils/makehex.py program.bin > program.hex
35
+
36
+ program.bin : program.elf program.lst
37
+ ${OBJCOPY} -O binary program.elf program.bin
38
+
39
+ program.elf : $(PROGRAM_SOURCE ) $(LIB_SOURCE )
40
+ ${CC} $(RISCV_CC_OPT ) -nostartfiles -O3 -T $(LDFILE ) -I ../lib -I ../lib/fat -I ../lib/upng -I ../../../../common $(EXTRA_CC_ARGS ) $(PROGRAM_SOURCE ) $(LIB_SOURCE ) -o program.elf -lm
41
+
42
+ .PHONY : all clean run
You can’t perform that action at this time.
0 commit comments