-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (23 loc) · 831 Bytes
/
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
HOST_CC := gcc
CROSS_COMPILE := riscv64-linux-gnu-
AS := ${CROSS_COMPILE}as
LD := ${CROSS_COMPILE}ld
OBJCOPY := ${CROSS_COMPILE}objcopy
SDCARD := "replace_device_in_burn_of_makefile_with_your_sdcard"
bin/BOOT0.bin: bin/yuan_spl.bin tools/mksunxiboot
./tools/mksunxiboot bin/yuan_spl.bin bin/BOOT0.bin
bin/yuan_spl.bin: yuan_spl.s yuan_spl.ld
${AS} yuan_spl.s -o bin/yuan_spl.o
${LD} -T yuan_spl.ld bin/yuan_spl.o -o bin/yuan_spl.elf
${OBJCOPY} -O binary -S bin/yuan_spl.elf bin/yuan_spl.bin
dis: bin/yuan_spl_bootable.bin
riscv64-linux-gnu-objdump -b binary -m riscv:rv64 -D bin/BOOT0.bin
tools/mksunxiboot:
${HOST_CC} -o tools/mksunxiboot mksunxiboot.c
burn: bin/BOOT0.bin
sudo dd if=bin/BOOT0.bin of=${SDCARD} bs=512 seek=16 conv=sync
clean:
rm -rf bin/
rm -rf tools/
$(shell mkdir -p bin)
$(shell mkdir -p tools)