From 4f97daf67e0baaf64251b5643af5c9552c522156 Mon Sep 17 00:00:00 2001 From: "Ian M." Date: Fri, 11 Sep 2026 03:45:03 +0000 Subject: initial commit Signed-off-by: Ian M. --- test/Makefile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/Makefile (limited to 'test/Makefile') diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..2cfdf95 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,36 @@ +# +# Copyright (c) 2026, Apollo Telephone Laboratories. +# Provided under the BSD-3 clause. +# + +IMG_PATH = sboot.img + +CC = clang +LD = ld.lld +OBJCOPY = llvm-objcopy + +CFLAGS = \ + -Wall \ + -pedantic \ + -ffreestanding \ + -mno-red-zone \ + -mno-avx \ + -mno-avx2 \ + -mno-sse2 \ + -nostdlib \ + -nostdinc + +.PHONY: all +all: test + rm -f $(IMG_PATH) + mkfs.fat -C $(IMG_PATH) 4096 + mmd -i $(IMG_PATH) ::/EFI + mmd -i $(IMG_PATH) ::/EFI/BOOT + mcopy -i $(IMG_PATH) kernel.bin :: + mcopy -i $(IMG_PATH) ../BOOTX64.EFI ::EFI/BOOT + +.PHONY: test +test: + $(CC) -c $(CFLAGS) test.c -o test.o + $(LD) -Tlink.ld test.o -o kernel.sys + $(OBJCOPY) -O binary kernel.sys kernel.bin -- cgit v1.2.3