Skip to content

Commit

Permalink
Remove makefile from kernel directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Sep 27, 2023
1 parent b433ba4 commit b9ee9fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
12 changes: 7 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ $(eval $(call DEFAULT_VAR,HOST_LDFLAGS,$(DEFAULT_HOST_LDFLAGS)))
override DEFAULT_HOST_LIBS :=
$(eval $(call DEFAULT_VAR,HOST_LIBS,$(DEFAULT_HOST_LIBS)))

override DEFAULT_ZIGFLAGS := -Doptimize=ReleaseSafe
$(eval $(call DEFAULT_VAR,ZIGFLAGS,$(DEFAULT_ZIGFLAGS)))

.PHONY: all
all: $(IMAGE_NAME).iso

Expand Down Expand Up @@ -62,12 +65,12 @@ limine:

.PHONY: kernel
kernel:
$(MAKE) -C kernel
cd kernel && zig build $(ZIGFLAGS)

$(IMAGE_NAME).iso: limine kernel
rm -rf iso_root
mkdir -p iso_root
cp -v kernel/kernel.elf \
cp -v kernel/zig-out/bin/kernel \
limine.cfg limine/limine-bios.sys limine/limine-bios-cd.bin limine/limine-uefi-cd.bin iso_root/
mkdir -p iso_root/EFI/BOOT
cp -v limine/BOOTX64.EFI iso_root/EFI/BOOT/
Expand All @@ -87,16 +90,15 @@ $(IMAGE_NAME).hdd: limine kernel
./limine/limine bios-install $(IMAGE_NAME).hdd
mformat -i $(IMAGE_NAME).hdd@@1M
mmd -i $(IMAGE_NAME).hdd@@1M ::/EFI ::/EFI/BOOT
mcopy -i $(IMAGE_NAME).hdd@@1M kernel/kernel.elf limine.cfg limine/limine-bios.sys ::/
mcopy -i $(IMAGE_NAME).hdd@@1M kernel/zig-out/bin/kernel limine.cfg limine/limine-bios.sys ::/
mcopy -i $(IMAGE_NAME).hdd@@1M limine/BOOTX64.EFI ::/EFI/BOOT
mcopy -i $(IMAGE_NAME).hdd@@1M limine/BOOTIA32.EFI ::/EFI/BOOT

.PHONY: clean
clean:
rm -rf iso_root $(IMAGE_NAME).iso $(IMAGE_NAME).hdd
$(MAKE) -C kernel clean
rm -rf kernel/zig-cache kernel/zig-out

.PHONY: distclean
distclean: clean
rm -rf limine ovmf
$(MAKE) -C kernel distclean
2 changes: 0 additions & 2 deletions kernel/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/limine-zig
/zig-cache
/zig-out
/*.elf
21 changes: 0 additions & 21 deletions kernel/GNUmakefile

This file was deleted.

4 changes: 2 additions & 2 deletions limine.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TIMEOUT=3
PROTOCOL=limine

# Path to the kernel to boot. boot:/// represents the partition on which limine.cfg is located.
KERNEL_PATH=boot:///kernel.elf
KERNEL_PATH=boot:///kernel

# Same thing, but without KASLR.
:Limine Barebones (KASLR off)
Expand All @@ -16,4 +16,4 @@ TIMEOUT=3
# Disable KASLR (it is enabled by default for relocatable kernels)
KASLR=no

KERNEL_PATH=boot:///kernel.elf
KERNEL_PATH=boot:///kernel

0 comments on commit b9ee9fc

Please sign in to comment.