2015-07-20 17:18:27 +04:00
|
|
|
CXX=g++ -Wall -m32
|
|
|
|
EXEC=kernel.bin
|
2015-07-19 11:52:01 +04:00
|
|
|
|
2015-07-20 17:18:27 +04:00
|
|
|
export CXX
|
|
|
|
|
|
|
|
all:$(EXEC)
|
2015-07-20 16:58:34 +04:00
|
|
|
|
|
|
|
#----- Kernel -----
|
2015-07-20 17:18:27 +04:00
|
|
|
$(EXEC):entry.o main.o GDT/gdt.o
|
2015-07-20 12:37:21 +04:00
|
|
|
ld -m elf_i386 --entry=_start -Ttext=0x100000 -o $@ $^
|
2015-07-20 16:58:34 +04:00
|
|
|
#-----------------
|
|
|
|
|
2015-07-19 11:52:01 +04:00
|
|
|
|
2015-07-20 16:58:34 +04:00
|
|
|
#----- Entry & Main-----
|
2015-07-19 11:52:01 +04:00
|
|
|
entry.o:entry.asm
|
|
|
|
nasm -f elf $^
|
2015-07-20 16:34:46 +04:00
|
|
|
main.o:main.cpp
|
2015-07-20 17:18:27 +04:00
|
|
|
$(CXX) -c $^ -o $@
|
2015-07-20 16:58:34 +04:00
|
|
|
#-----------------------
|
|
|
|
|
|
|
|
|
|
|
|
#----- GDT -----
|
2015-07-20 16:34:46 +04:00
|
|
|
GDT/gdt.o:
|
2015-07-20 16:58:34 +04:00
|
|
|
cd ./GDT && make
|
|
|
|
#---------------
|
|
|
|
|
2015-07-18 20:23:49 +04:00
|
|
|
|
2015-07-20 16:58:34 +04:00
|
|
|
#----- Other -----
|
2015-07-20 17:23:21 +04:00
|
|
|
.PHONY:clean
|
|
|
|
|
2015-07-18 20:23:49 +04:00
|
|
|
clean:
|
2015-07-20 16:34:46 +04:00
|
|
|
cd ./GDT/ && make clean
|
2015-07-19 11:52:01 +04:00
|
|
|
rm ./*.o
|
2015-07-20 17:18:27 +04:00
|
|
|
rm ./$(EXEC)
|
|
|
|
#-----------------
|