mirror of
https://github.com/rdolbeau/NuBusFPGA.git
synced 2024-12-23 01:30:32 +00:00
29 lines
939 B
Bash
Executable File
29 lines
939 B
Bash
Executable File
#!/bin/bash -x
|
|
|
|
BASE_FB=${1:-0x8F800000}
|
|
|
|
GCCDIR=~/LITEX/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14
|
|
GCCPFX=riscv64-unknown-elf-
|
|
GCCLINK=${GCCDIR}/bin/${GCCPFX}gcc
|
|
|
|
#GCCDIR=/opt/rv32bk
|
|
#GCCPFX=riscv32-buildroot-linux-gnu-
|
|
|
|
GCCDIR=~dolbeau2/LITEX/buildroot-rv32/output/host
|
|
GCCPFX=riscv32-buildroot-linux-gnu-
|
|
|
|
GCC=${GCCDIR}/bin/${GCCPFX}gcc
|
|
OBJCOPY=${GCCDIR}/bin/${GCCPFX}objcopy
|
|
|
|
OPT=-Os #-fno-inline
|
|
ARCH=rv32im_zba_zbb_zbt
|
|
|
|
PARAM="-DBASE_FB=${BASE_FB}"
|
|
|
|
if test "x$1" != "xASM"; then
|
|
$GCC $OPT -S -o blit.s $PARAM -march=$ARCH -mabi=ilp32 -mstrict-align -fno-builtin-memset -nostdlib -ffreestanding -nostartfiles blit.c
|
|
fi
|
|
$GCC $OPT -c -o blit.o $PARAM -march=$ARCH -mabi=ilp32 -mstrict-align -fno-builtin-memset -nostdlib -ffreestanding -nostartfiles blit.s &&
|
|
$GCCLINK $OPT -o blit $PARAM -march=$ARCH -mabi=ilp32 -T blit.lds -nostartfiles blit.o &&
|
|
$OBJCOPY -O binary -j .text -j .rodata blit blit.raw
|