export AS=fasm
export ASFLAGS=
export CC=gcc
export CFLAGS=-ansi -c -ffreestanding -m32 -Wall
export CPP=gcc
export CPPFLAGS=
export LDFLAGS=-melf_i386 -nostdlib -o elf32-i386 --print-gc-sections -r -T ../objlink.ld --warn-unresolved-symbols 
OBJS=boot/boot.o init/init.o

all : build
	make clean

build : $(OBJS)
	ld -melf_i386 -nostdlib -T link.ld --warn-unresolved-symbols $(OBJS)

boot/boot.o :
	(cd boot; make)

init/init.o :
	(cd init; make)

clean :
	(cd boot; make clean; cd ../; cd init; make clean; cd ../)
