aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile40
1 files changed, 9 insertions, 31 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 00b523e..8a27691 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,40 +1,18 @@
-TESTS :=
+check:
+ $(MAKE) -f scripts/makefile check
-ARCH ?= riscv64
-CROSS_COMPILE ?= $(ARCH)-unknown-elf-
+.DEFAULT:
+ $(MAKE) -f scripts/makefile $<
-LLVM ?= 0
-COMPILER != [ "$(LLVM)" != "0" ] \
- && echo clang --target="$(CROSS_COMPILE)" \
- || echo $(CROSS_COMPILE)gcc
-
-OBFLAGS := -ffreestanding -nostdlib -std=c17 -g
-INCLUDEFLAGS := -I ../include -I.
-WARNFLAGS := -Wall -Wextra
-COMPILE := $(COMPILER) $(WARNFLAGS) $(INCLUDEFLAGS) $(OBFLAGS)
-
-GEN_INITRD := cpio -H newc -o >
-QEMU := qemu-system-$(ARCH) -machine virt -kernel ../kmi.bin \
- -serial stdio \
- -monitor none \
- -nographic \
- -no-reboot \
- -initrd
-
-COMMON := build/printf.o ../kmi.bin ../include/kmi/syscalls.h
-
-include noop/source.mk
-include hello-world/source.mk
-
-.PHONY: check
-check: $(TESTS)
+SOURCES != echo */source.mk
+DO != echo -n > tests.mk
+include $(SOURCES)
build/printf.o: common/printf.c
- mkdir -p build
- $(COMPILE) -c common/printf.c -o build/printf.o
+ mkdir -p build && $(COMPILE_TEST) -c common/printf.c -o build/printf.o
RM ?= rm
.PHONY: clean
clean:
- $(RM) -rf build
+ $(RM) -rf build reports