39 lines
577 B
Makefile
39 lines
577 B
Makefile
CXX=g++ -Wall -m32
|
|
EXEC=kernel.bin
|
|
|
|
export CXX
|
|
|
|
all:$(EXEC)
|
|
|
|
#----- Kernel -----
|
|
$(EXEC):entry.o main.o GDT/gdt.o Helpers/helpers.o
|
|
$(CXX) --entry=_start -Ttext=0x100000 -o $@ $^
|
|
#-----------------
|
|
|
|
|
|
#----- Entry & Main-----
|
|
entry.o:entry.asm
|
|
nasm -f elf $^
|
|
main.o:main.cpp
|
|
$(CXX) -c $^ -o $@
|
|
#-----------------------
|
|
|
|
|
|
#----- GDT -----
|
|
GDT/gdt.o:
|
|
cd ./GDT && make
|
|
#---------------
|
|
|
|
#----- Helpers -----
|
|
Helpers/helpers.o:
|
|
cd ./Helpers/ && make
|
|
#---------------
|
|
|
|
#----- Other -----
|
|
.PHONY:clean
|
|
|
|
clean:
|
|
cd ./GDT/ && make clean
|
|
rm ./*.o
|
|
rm ./$(EXEC)
|
|
#-----------------
|