CC = gcc
LD = ld
OPTIONS = -fno-builtin 
INCLUDE = "../include"
OFILES = driver.o act.o system/system.o ps2/ps2.o fdd/fdd.o

.c.o:
	$(CC) -c -I$(INCLUDE) $(OPTIONS) -o $*.o $<
	
all: dev.o

dev.o: $(OFILES)
	$(LD) -r --oformat=elf32-i386 -o $*.o $(OFILES)

system/system.o:
	cd system && make all

ps2/ps2.o:
	cd ps2 && make all

fdd/fdd.o:
	cd fdd && make all

clean:
	rm -f	*.o
	cd system && make clean
	cd ps2 && make clean
	cd fdd && make clean
