feat: kprintf now goes into dedicated pseudo-dev rather than flooding the framebuffer
[lunaix-os.git] / lunaix-os / makefile
index 75135161de33113b4d8b938d09b57894aa2f4e0a..af07f60420e38e2efa911775856cdd954a27bf5b 100644 (file)
@@ -37,13 +37,15 @@ $(kbuild_dir):
        @mkdir -p $(os_img_dir)/boot/grub
        @mkdir -p $(os_img_dir)/usr
 
+.PHONY: kernel
 export BUILD_DIR=$(kbin_dir)
 export BUILD_NAME=$(kbin)
-$(kbin):
+kernel:
        $(call status,TASK,$(notdir $@))
        @$(MAKE) $(MKFLAGS) -I $(mkinc_dir) -f kernel.mk all
 
-$(kimg): usr/build $(kbin)
+.PHONY: image
+image: usr/build kernel
        $(call status,TASK,$(notdir $@))
        @./config-grub.sh ${OS_NAME} $(os_img_dir)/boot/grub/grub.cfg
        @cp -r usr/build/* $(os_img_dir)/usr
@@ -57,10 +59,10 @@ check: $(DEPS) check-cc GRUB_TEMPLATE
 prepare: check $(os_img_dir)
 
 export BUILD_MODE=release
-bootable: $(kbuild_dir) $(kimg)
+bootable: $(kbuild_dir) image
 
 export BUILD_MODE=debug
-bootable-debug: $(kbuild_dir) $(kimg)
+bootable-debug: $(kbuild_dir) image
 
 user:
        $(call status,$@)
@@ -89,8 +91,7 @@ debug-qemu: all-debug
        @i686-elf-objcopy --only-keep-debug $(kbin) $(kbuild_dir)/kernel.dbg
        @qemu-system-i386 $(call get_qemu_options,$(kimg))
        @sleep 1
-       @$(QEMU_MON_TERM) -- telnet 127.0.0.1 $(QEMU_MON_PORT)
-       @gdb -s $(kbuild_dir)/kernel.dbg -ex "target remote localhost:1234"
+       @QMPORT=$(QEMU_MON_PORT) gdb -s $(kbuild_dir)/kernel.dbg -ex "target remote localhost:1234"
 
 debug-qemu-vscode: all-debug
        @i686-elf-objcopy --only-keep-debug $(kbin) $(kbuild_dir)/kernel.dbg