YACBA/Makefile
Lain Iwakura 30f65e05d8
Some checks failed
Build YACBA ISO / build-iso (push) Failing after 1m10s
added ci/cd + iso
2025-06-22 21:51:00 +03:00

45 lines
907 B
Makefile

ASM = nasm
CC = clang
LD = ld
ASMFLAGS = -f bin
CFLAGS = -m32 -ffreestanding -nostdlib -nodefaultlibs -fno-builtin -fno-stack-protector -target i386-pc-none-elf
LDFLAGS = -arch i386 -static -e _main -T linker.ld
ifeq ($(shell uname),Darwin)
LDFLAGS = -arch i386 -static -e _main
else
LDFLAGS = -m elf_i386 -T linker.ld
endif
all: os.bin
bootloader.bin: bootloader.asm gdt.asm print32.asm switch_pm.asm
$(ASM) $(ASMFLAGS) bootloader.asm -o bootloader.bin
kernel.o: kernel.c
$(CC) $(CFLAGS) -c kernel.c -o kernel.o
kernel.bin: kernel.o
$(LD) $(LDFLAGS) kernel.o -o kernel.bin
os.bin: bootloader.bin kernel.bin
cat bootloader.bin kernel.bin > os.bin
truncate -s 1440K os.bin
clean:
rm -f *.bin *.o
test: os.bin
qemu-system-i386 -fda os.bin
usb: os.bin
./create_usb.sh
iso: os.bin
./build-iso.sh
docker-iso:
./docker-build.sh && ./build-iso.sh
.PHONY: all clean test usb iso docker-iso