vriscv/tests/Makefile

23 lines
430 B
Makefile
Raw Normal View History

2023-10-08 21:50:06 +02:00
AS=riscv32-elf-as
LD=riscv32-elf-ld
BUILD_DIR=../build/tests/
2023-11-03 16:35:08 +01:00
S_FILES := $(shell find ./ -name '*.s' -not -name 'exit_return.s')
2023-10-08 21:50:06 +02:00
NAMES = $(basename $(S_FILES))
OBJECTS=$(patsubst %, $(BUILD_DIR)/%, $(NAMES))
all: $(OBJECTS) run
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/%.o: %.s | $(BUILD_DIR)
$(AS) $^ -o $@
$(BUILD_DIR)/%: $(BUILD_DIR)/%.o | $(BUILD_DIR)
$(LD) $^ -o $@ -nostdlib
.SILENT: run
run:
bash test.sh