# Makefile for JamesM's kernel tutorials.
# The C and C++ rules are already setup by default.
# The only one that needs changing is the assembler 
# rule, as we use nasm instead of GNU as.

SOURCES=boot.o main.o monitor.o common.o descriptor_tables.o isr.o interrupt.o gdt.o timer.o \
        kheap.o paging.o ordered_array.o fs.o initrd.o task.o process.o syscall.o kb.o
CC=/usr/local/cross/bin/i586-elf-gcc
CFLAGS=-nostdlib -nostdinc -fno-builtin -I../include
LDFLAGS=-T link.ld
ASFLAGS=-felf

all: $(SOURCES) link

clean:
	-rm *.o casnuz casnuz.bin

link:
	/usr/local/cross/bin/i586-elf-ld $(LDFLAGS) -o casnuz $(SOURCES)

.s.o:
	nasm $(ASFLAGS) $<
