Updated makefile to create the disk_images directory if it doesn't exist

This commit is contained in:
2025-10-20 17:03:47 +01:00
parent 44e4447d21
commit 0b9014d846
2 changed files with 5 additions and 1 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
*.swp *.swp
disk-images/* disk_images/*

View File

@@ -7,12 +7,14 @@ DATA_DIR=data
# CD image # CD image
cdrom: $(BUILD_DIR)/crawos.iso cdrom: $(BUILD_DIR)/crawos.iso
$(BUILD_DIR)/crawos.iso: floppy_image $(BUILD_DIR)/crawos.iso: floppy_image
mkdir -p disk_images
mkisofs -quiet -V 'CRAWOS' -input-charset iso8859-1 -o disk_images/crawos.iso -b crawos.img disk_images/ mkisofs -quiet -V 'CRAWOS' -input-charset iso8859-1 -o disk_images/crawos.iso -b crawos.img disk_images/
# Floppy image # Floppy image
# Fat12 # Fat12
floppy_image: $(BUILD_DIR)/crawos.img floppy_image: $(BUILD_DIR)/crawos.img
$(BUILD_DIR)/crawos.img: bootloader kernel $(BUILD_DIR)/crawos.img: bootloader kernel
mkdir -p disk_images
dd if=/dev/zero of=$(BUILD_DIR)/crawos.img bs=512 count=2880 # Use dd to make a disk image dd if=/dev/zero of=$(BUILD_DIR)/crawos.img bs=512 count=2880 # Use dd to make a disk image
mkfs.fat -F 12 -n "CRAWOS" $(BUILD_DIR)/crawos.img # Format the disk image with fat12 mkfs.fat -F 12 -n "CRAWOS" $(BUILD_DIR)/crawos.img # Format the disk image with fat12
dd if=$(BUILD_DIR)/boot.bin of=$(BUILD_DIR)/crawos.img conv=notrunc # Put boot.bin inside the disk image dd if=$(BUILD_DIR)/boot.bin of=$(BUILD_DIR)/crawos.img conv=notrunc # Put boot.bin inside the disk image
@@ -23,11 +25,13 @@ $(BUILD_DIR)/crawos.img: bootloader kernel
# Bootloader # Bootloader
bootloader: $(BUILD_DIR)/boot.bin bootloader: $(BUILD_DIR)/boot.bin
$(BUILD_DIR)/boot.bin: $(BUILD_DIR)/boot.bin:
mkdir -p disk_images
$(ASM) $(SRC_DIR)/bootload/boot.asm -f bin -o $ $(BUILD_DIR)/boot.bin $(ASM) $(SRC_DIR)/bootload/boot.asm -f bin -o $ $(BUILD_DIR)/boot.bin
# Kernel # Kernel
kernel: $(BUILD_DIR)/kernel.bin kernel: $(BUILD_DIR)/kernel.bin
$(BUILD_DIR)/kernel.bin: $(BUILD_DIR)/kernel.bin:
mkdir -p disk_images
$(ASM) $(SRC_DIR)/kernel/kernel.asm -f bin -o $ $(BUILD_DIR)/kernel.bin $(ASM) $(SRC_DIR)/kernel/kernel.asm -f bin -o $ $(BUILD_DIR)/kernel.bin
# Clean # Clean