mirror of
https://github.com/steveschnepp/x48ng
synced 2024-11-16 19:48:35 +01:00
variable target for baremetal
This commit is contained in:
parent
fc1229f81b
commit
74e45a84b1
3 changed files with 17 additions and 6 deletions
10
.github/workflows/c-cpp.yml
vendored
10
.github/workflows/c-cpp.yml
vendored
|
@ -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
|
||||
|
|
11
Makefile
11
Makefile
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue