Makefile - lingfeishengtian/PistachiOS GitHub Wiki

The Makefile is assists in reducing the workload of the developer by automatically searching, making, and running the code for you so there is no need to manually type every single command individually.

This Makefile supports Windows, MacOS, and Linux if the dependencies were installed correctly.

Through a trick with Make, all the c and assembly source files are recursively found through the src folder and all its subdirectories. Then all of these directories have a corresponding directory in the build folder which is automatically created through the use of mkdir. In addition, the source files are all automatically compiled through their "wildcard" rules. In the build directory, all of the compiled object files are stored and used to link together and create the final elf file.

There are three commands that can be used with the makefile.

make or make kernel8.img

Creates a kernel8.img.

make qemu

Creates a kernel8.img and runs the file in a virtual machine in qemu.

make qemu-monitor

Creates a kernel8.img and runs the file in a monitored virtual machine in qemu. Through this monitoring, the registers of the machine can be displayed along with other useful debugging information.