variable target for baremetal

This commit is contained in:
Steve Schnepp 2023-09-01 21:18:12 +02:00
parent fc1229f81b
commit 74e45a84b1
3 changed files with 17 additions and 6 deletions

View file

@ -21,7 +21,11 @@ jobs:
run: make clean && make GUI=x11
- name: make sdl1
run: make clean && make GUI=sdl1
- name: install baremetal deps
run: sudo apt-get -y install gcc-riscv64-unknown-elf picolibc-riscv64-unknown-elf srecord
- name: make baremetal
- name: install baremetal native deps
run: sudo apt-get -y install srecord
- name: make baremetal native
run: make clean && make GUI=baremetal
- name: install baremetal rv32e deps
run: sudo apt-get -y install gcc-riscv64-unknown-elf picolibc-riscv64-unknown-elf
- name: make baremetal rv32e
run: make clean && make GUI=baremetal TARGET=rv32e

View file

@ -26,11 +26,16 @@ ifeq ($(GUI), sdl1)
CFLAGS += $(shell pkg-config --cflags SDL_gfx sdl12_compat) -DGUI_IS_SDL1=1
LIBS += $(shell pkg-config --libs SDL_gfx sdl12_compat)
endif
ifeq ($(GUI), baremetal)
ifeq ($(TARGET), rv32e)
CC = riscv64-unknown-elf-gcc
CFLAGS += -march=rv32e -mabi=ilp32e --specs=picolibc.specs -DGUI_IS_BAREMETAL=1
LIBS += -Wl,--print-memory-usage
CFLAGS += -march=rv32e -mabi=ilp32e --specs=picolibc.specs
LIBS +=-T baremetal.ld
endif
ifeq ($(GUI), baremetal)
CFLAGS += -DGUI_IS_BAREMETAL=1
LIBS += -Wl,--print-memory-usage
OS_TYPE=baremetal
# There is no readline in baremetal
WITH_DEBUGGER=no

View file

@ -17,12 +17,14 @@ sample_getc(FILE *file)
return EOF;
}
#ifdef _PICOLIBC_MINOR__
static FILE __stdio = FDEV_SETUP_STREAM(sample_putc,
sample_getc,
NULL,
_FDEV_SETUP_RW);
FILE *const __iob[3] = { &__stdio, &__stdio, &__stdio };
#endif // _PICOLIBC_MINOR__
#if _PICOLIBC_MINOR__ >= 7
FILE *const stdin = __iob[0];