PiegOS/kernel/Makefile
2015-07-22 13:22:53 +04:00

40 lines
614 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=_kernelEntry -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
cd ./Helpers/ && make clean
-rm ./*.o
-rm ./$(EXEC)
#-----------------