mirror of
https://git.code.sf.net/p/openocd/code
synced 2024-11-22 16:36:25 +00:00
36597636f2
Some file miss completely the license tag. Add the SPDX tag, using the same GPL-2.0-or-later license of the OpenOCD project. The SPDX tag on files *.c is incorrect, as it should use the C99 single line comment using '//'. But current checkpatch doesn't allow C99 comments, so keep using standard C comments, by now. Change-Id: I24bd362eeb6b74f09aceb9b757d45cbfa4afe334 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7160 Tested-by: jenkins
54 lines
1.2 KiB
Makefile
54 lines
1.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
BIN2C = ../../../../src/helper/bin2char.sh
|
|
|
|
CROSS_COMPILE ?= riscv64-unknown-elf-
|
|
|
|
RISCV_CC=$(CROSS_COMPILE)gcc
|
|
RISCV_OBJCOPY=$(CROSS_COMPILE)objcopy
|
|
RISCV_OBJDUMP=$(CROSS_COMPILE)objdump
|
|
|
|
CFLAGS = -nostdlib -nostartfiles -Wall -Werror -Os -fPIC -Wunused-result -g
|
|
RISCV32_CFLAGS = -march=rv32e -mabi=ilp32e $(CFLAGS)
|
|
RISCV64_CFLAGS = -march=rv64i -mabi=lp64 $(CFLAGS)
|
|
|
|
all: riscv32_fespi.inc riscv64_fespi.inc
|
|
|
|
.PHONY: clean
|
|
|
|
# .c -> .o
|
|
riscv32_%.o: riscv_%.c
|
|
$(RISCV_CC) -c $(RISCV32_CFLAGS) $^ -o $@
|
|
|
|
riscv64_%.o: riscv_%.c
|
|
$(RISCV_CC) -c $(RISCV64_CFLAGS) $< -o $@
|
|
|
|
# .S -> .o
|
|
riscv32_%.o: riscv_%.S
|
|
$(RISCV_CC) -c $(RISCV32_CFLAGS) $^ -o $@
|
|
|
|
riscv64_%.o: riscv_%.S
|
|
$(RISCV_CC) -c $(RISCV64_CFLAGS) $^ -o $@
|
|
|
|
# .o -> .elf
|
|
riscv32_%.elf: riscv32_%.o riscv32_wrapper.o
|
|
$(RISCV_CC) -T riscv.lds $(RISCV32_CFLAGS) $^ -o $@
|
|
|
|
riscv64_%.elf: riscv64_%.o riscv64_wrapper.o
|
|
$(RISCV_CC) -T riscv.lds $(RISCV64_CFLAGS) $^ -o $@
|
|
|
|
# .elf -> .bin
|
|
%.bin: %.elf
|
|
$(RISCV_OBJCOPY) -Obinary $< $@
|
|
|
|
# .bin -> .inc
|
|
%.inc: %.bin
|
|
$(BIN2C) < $< > $@
|
|
|
|
# utility
|
|
%.lst: %.elf
|
|
$(RISCV_OBJDUMP) -S $< > $@
|
|
|
|
clean:
|
|
-rm -f *.elf *.o *.lst *.bin *.inc
|