diff options
| author | EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> | 2024-05-06 23:00:36 -0400 |
|---|---|---|
| committer | EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> | 2024-05-06 23:00:36 -0400 |
| commit | 33bc3446d237a95f1bbf9d5d70a170fa4c4241cd (patch) | |
| tree | 60a07c07c59b92ed21407f59931f25285b89f2aa /makefile | |
| parent | 982baec992d48343e455bf6e32ca96fbdcddda01 (diff) | |
Improved makefile a bit more and got it working with the other files
Diffstat (limited to 'makefile')
| -rw-r--r-- | makefile | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1,24 +1,24 @@ # The makefile
-OS_NAME := emuos
-ARCH ?= x86_64
-export SYSROOT = $(PWD)/sysroot
+OS_NAME := emuos
+export ARCH ?= x86_64
+export SYSROOT = $(PWD)/sysroot
# Variables for easy access of tools like gcc and nasm
export CC = $(ARCH)-elf-gcc
export CXX = $(ARCH)-elf-g++
export AR = $(ARCH)-elf-ar
export NASM = nasm
-QEMU = qemu-system-x86_64
+QEMU = qemu-system-$(ARCH)
#ASMFLAGS = -felf32
#CXXFLAGS := -ffreestanding -O2 -Wall -Wextra -fno-exceptions -fno-rtti
#LDFLAGS := -ffreestanding -O2 -nostdlib
-.PHONY: all grub clean build-all
+.PHONY: all limine clean build-all
-all: build-all grub
+all: build-all limine
-build-all: kernel/kernel.bin libc.a
+build-all: kernel/kernel.bin libc/libc.a
libc/libc.a: install-headers
$(info [INFO] Building libc)
@@ -28,26 +28,27 @@ kernel/kernel.bin: libc/libc.a install-headers $(info [INFO] Building kernel)
$(MAKE) -C ./kernel/ ARCH=$(ARCH) PREFIX=$(PWD)
-grub: build-all grub.cfg
+limine: build-all
+ cp kernel/kernel.bin isodir/boot
xorriso -as mkisofs -b boot/limine/limine-bios-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot boot/limine/limine-uefi-cd.bin \
-efi-boot-part --efi-boot-image --protective-msdos-label \
isodir -o emuos.iso
-qemu: grub
+qemu: limine
$(QEMU) -no-shutdown -no-reboot --serial stdio -s -m 512 -hda $(OS_NAME).iso
install: install-headers install-libraries
install-headers:
$(MAKE) -C ./kernel/ install-headers
- $(MAKE) -C ./libs/libc/ install-headers
+ $(MAKE) -C ./libc/ install-headers
install-libraries:
- $(MAKE) -C ./libs/libc/ install-lib
+ $(MAKE) -C ./libc/ install-lib
clean:
-@$(MAKE) -C ./kernel/ clean
- -@$(MAKE) -C ./libs/libc/ clean
+ -@$(MAKE) -C ./libc/ clean
-@$(RM) $(wildcard *.bin *.a)
|
