From 33bc3446d237a95f1bbf9d5d70a170fa4c4241cd Mon Sep 17 00:00:00 2001 From: EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> Date: Mon, 6 May 2024 23:00:36 -0400 Subject: Improved makefile a bit more and got it working with the other files --- makefile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 21c698c..2581e21 100644 --- a/makefile +++ b/makefile @@ -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) -- cgit v1.2.3-70-g09d2