#                   Ace OS makefile for gcc 3.1 
#				- Created by Sam (samuelhard@yahoo.com) 
#------------------------------------------------------------------------------------------------
KernelObjects = Kernel.o Processor.o Timer.o  CKernel.o  MemMan.o Heap.o DeviceDriver.o IO.o MemMove.o \
		VGAText.o VGACursor.o Keyboard.o CKeyboard.o PIC.o PCI.o RTC.o GSH.o Harddisk.o \
		HMess.o Beep.o Printf.o  Mouse.o CMouse.o Partition.o FAT.o NumConvert.o String.o
LibDir = c:\djgpp\lib\gcc-lib\djgpp\3.1
Kernel	:	$(KernelObjects)
	ld  -Ttext 0x19000  --oformat binary -o Kernel.bin $(KernelObjects) -L$(LibDir) -lc -lgcc 
.PHONY	:	All
All	:	Kernel Boot	
.PHONY	:	Boot
Boot	:	Boot/Boot.asm Boot/OSLoader.asm Boot/MakeBoot.c 
	nasmw -i Includes -w+orphan-labels -o Boot.bin Boot/Boot.asm
	gcc -o MakeBoot.exe Boot/MakeBoot.c
	nasmw -i Includes -w+orphan-labels -o OSLoader.bin Boot/OSLoader.asm
.PHONY	:	Clean
Clean	:
	del *.o
	del *.bin
	del *.exe
Kernel.o	:	Kernel/Kernel.asm
	nasmw -i Includes -w+orphan-labels -f coff -o Kernel.o Kernel/Kernel.asm
CKernel.o	:	Includes/Collect.h Includes/Processor.h Kernel/CKernel.cpp
	gxx -o2 -fno-exceptions  -ffreestanding -c  -I Includes -o CKernel.o Kernel/CKernel.cpp
Processor.o	:	Includes/Common.inc Kernel/Processor.asm
	nasmw -i Includes -w+orphan-labels -f coff -o Processor.o Kernel/Processor.asm
MemMan.o	:	Includes/Common.inc Kernel/MemMan.asm
	nasmw -i Includes -w+orphan-labels -f coff -o MemMan.o Kernel/MemMan.asm
Heap.o		:	MemMan.o Includes/Heap.h  Kernel/Heap.c
	gcc -ffreestanding -c  -I Includes -o Heap.o Kernel/Heap.c
Keyboard.o	:	Includes/HMess.inc Includes/Common.inc Kernel/Keyboard.asm 
	nasmw -i Includes -w+orphan-labels -f coff -o Keyboard.o Kernel/Keyboard.asm
CKeyboard.o	:	Kernel/CKeyboard.c
	gcc -ffreestanding -c  -I Includes -o CKeyboard.o Kernel/CKeyboard.c
VGAText.o	:	IO.o Includes/Common.inc Includes/VGAText.inc Kernel/VGAText.asm
	nasmw -i Includes -w+orphan-labels -f coff -o VGAText.o Kernel/VGAText.asm
VGACursor.o	:	IO.o Kernel/VGACursor.c
	gcc -ffreestanding -c  -I Includes -o VGACursor.o Kernel/VGACursor.c
PIC.o		:	Kernel/PIC.asm
	nasmw -i Includes -w+orphan-labels -f coff -o PIC.o Kernel/PIC.asm
IO.o		:	Kernel/IO.asm
	nasmw -i Includes -w+orphan-labels -f coff -o IO.o Kernel/IO.asm
Timer.o		:	Kernel/Timer.asm
	nasmw -i Includes -w+orphan-labels -f coff -o Timer.o Kernel/Timer.asm
PCI.o		:	IO.o Includes/PCI.h Kernel/PCI.cpp
	gcc -fno-exceptions -ffreestanding -c  -I Includes -o PCI.o Kernel/PCI.cpp
RTC.o		:	IO.o Includes/RTC.h Kernel/RTC.c
	gcc -ffreestanding -c  -I Includes -o RTC.o Kernel/RTC.c
Printf.o	:	VGAText.o VGACursor.o Kernel/Printf.c
	gcc -ffreestanding -c -I Includes -o Printf.o Kernel/Printf.c
MemMove.o	:	Kernel/MemMove.asm
	nasmw -i Includes -w+orphan-labels -f coff -o MemMove.o Kernel/MemMove.asm
String.o	:	Kernel/String.c
	gcc -ffreestanding -c  -I Includes -o String.o Kernel/String.c
Harddisk.o	:	GSH.o Includes/Harddisk.h Kernel/Harddisk.cpp
	gxx -fno-exceptions -ffreestanding -c  -I Includes -o Harddisk.o Kernel/Harddisk.cpp
GSH.o	:	Includes/GSH.h Kernel/GSH.cpp
	gxx -fno-exceptions -ffreestanding -c  -I Includes -o GSH.o Kernel/GSH.cpp
HMess.o	:	Includes/HMess.h Kernel/HMess.c
	gcc -ffreestanding -c  -I Includes -o HMess.o Kernel/HMess.c
DeviceDriver.o	:	Includes/DeviceDriver.h Kernel/DeviceDriver.cpp
	gxx -fno-exceptions -ffreestanding -c  -I Includes -o DeviceDriver.o Kernel/DeviceDriver.cpp
Beep.o	:	Kernel/Beep.c
	gcc -ffreestanding -c  -I Includes -o Beep.o Kernel/Beep.c
Mouse.o	:	Includes/HMess.inc Includes/Common.inc Kernel/Mouse.asm 
	nasmw -i Includes -w+orphan-labels -f coff -o Mouse.o Kernel/Mouse.asm
CMouse.o	:	Includes/Mouse.h Kernel/CMouse.c
	gcc -ffreestanding -c  -I Includes -o CMouse.o Kernel/CMouse.c
Partition.o	:	Includes/Partition.h Kernel/Partition.cpp
	gxx -fno-exceptions -ffreestanding -c  -I Includes -o Partition.o Kernel/Partition.cpp
FAT.o	:	Includes/FAT.h Kernel/FAT.cpp
	gxx -fno-exceptions -ffreestanding -c  -I Includes -o FAT.o Kernel/FAT.cpp
NumConvert.o	:	Kernel/NumConvert.c
	gcc -ffreestanding -c  -I Includes -o NumConvert.o Kernel/NumConvert.c

