Edit all Makefile

This commit is contained in:
manzerbredes 2015-07-20 17:18:27 +04:00
parent 3b171151bd
commit cbefa73a90
3 changed files with 36 additions and 8 deletions

View file

@ -1,11 +1,23 @@
EXEC=PiegOS
all:$(EXEC)
#----- Copy kernel -----
$(EXEC): kernel/kernel.bin
cp kernel/kernel.bin ./$(EXEC)
#-----------------------
PiegOS: kernel/kernel.bin
cp kernel/kernel.bin ./PiegOS
#----- Gen Kernel -----
kernel/kernel.bin:
cd kernel/ && make
#----------------------
#----- Other -----
clean:
cd kernel && make clean
rm PiegOS
rm $(EXEC)
#-----------------

View file

@ -1,5 +1,15 @@
gdt.o: gdt.cpp
g++ -m32 -c -o gdt.o gdt.cpp
EXEC=gdt.o
all:$(EXEC)
#----- GDT -----
$(EXEC): gdt.cpp
$(CXX) -c -o $(EXEC) gdt.cpp
#---------------
#----- Other -----
clean:
rm *.o
#----------------

View file

@ -1,7 +1,12 @@
CXX=g++ -Wall -m32
EXEC=kernel.bin
export CXX
all:$(EXEC)
#----- Kernel -----
kernel.bin:entry.o main.o GDT/gdt.o
$(EXEC):entry.o main.o GDT/gdt.o
ld -m elf_i386 --entry=_start -Ttext=0x100000 -o $@ $^
#-----------------
@ -10,7 +15,7 @@ kernel.bin:entry.o main.o GDT/gdt.o
entry.o:entry.asm
nasm -f elf $^
main.o:main.cpp
g++ -Wall -m32 -c $^ -o $@
$(CXX) -c $^ -o $@
#-----------------------
@ -24,4 +29,5 @@ GDT/gdt.o:
clean:
cd ./GDT/ && make clean
rm ./*.o
rm ./kernel.bin
rm ./$(EXEC)
#-----------------