diff --git a/.github/workflows/makefile.yaml b/.github/workflows/makefile.yaml new file mode 100644 index 0000000..e0fc223 --- /dev/null +++ b/.github/workflows/makefile.yaml @@ -0,0 +1,17 @@ +name: Build QEMU +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: gregdavill/setup-riscv-gnu-toolchain@v2.0 + - run: riscv-none-elf-gcc --version + - run: make TARGET=qemu TOOLCHAIN_PREFIX=riscv-none-elf- bin diff --git a/Makefile b/Makefile index 6de92fe..3de400a 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,11 @@ ELF := tmp/kernel.elf SRC := src TMP := tmp -GNATMAKE := riscv64-none-elf-gnatmake -LD := riscv64-none-elf-ld -AS := riscv64-none-elf-as -GCC := riscv64-none-elf-gcc -mcmodel=medany +TOOLCHAIN_PREFIX ?= riscv64-none-elf- +GNATMAKE := $(TOOLCHAIN_PREFIX)gnatmake +LD := $(TOOLCHAIN_PREFIX)ld +AS := $(TOOLCHAIN_PREFIX)as +GCC := $(TOOLCHAIN_PREFIX)gcc -mcmodel=medany ADA_DIRS := $(shell find $(SRC) -type f \( -name '*.adb' -o -name '*.ads' \) | xargs -n1 dirname | sort -u) ADA_INCLUDES := $(addprefix -I$(shell pwd)/, $(ADA_DIRS)) @@ -67,7 +68,7 @@ bin: all mkdir build; \ fi - riscv64-none-elf-objcopy -O binary $(ELF) build/kernel.bin --remove-section .riscv.attributes + $(TOOLCHAIN_PREFIX)objcopy -O binary $(ELF) build/kernel.bin --remove-section .riscv.attributes .PHONY: runtime runtime: