~increscent/rk3128-brom

ref: 73661af99c04bf720df79e92c2ff3c3ec2759363 rk3128-brom/uart/Makefile -rw-r--r-- 794 bytes
73661af9 — Robert Williams Custom UART is working! 4 months ago
                                                                                
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
CROSS_COMPILE=arm-none-eabi-
CC=$(CROSS_COMPILE)gcc
OBJCOPY=$(CROSS_COMPILE)objcopy
OBJDUMP=$(CROSS_COMPILE)objdump
ARM_ELF_FLAGS = -Og -g -marm -Wall -nostdlib -mcpu=cortex-a7

uart.bin: uart.elf uart.list
	$(OBJCOPY) -O binary \
		--only-section .text \
		--only-section .rodata \
		uart.elf uart.bin

uart.list: uart.elf
	$(OBJDUMP) -D uart.elf > uart.list

uart.o: uart.rs bits.rs
	rustc --emit obj -C opt-level=2 --target=armv7a-none-eabi -o uart.o uart.rs

uart.elf: uart.o entry.S uart.lds
	$(CC) $(ARM_ELF_FLAGS) uart.o entry.S -o uart.elf -T uart.lds

.PHONY: reset
reset:
	nrfjprog --family nrf52 -r

.PHONY: flash
flash: uart.bin
	nrfjprog --family nrf52 -e
	nrfjprog --family nrf52 --program uart.bin
	nrfjprog --family nrf52 -r

.PHONY: clean
clean:
	rm -f *.o *.elf *.list *.bin