BINDIR=bin/

CC=gcc -c -O2 -Wall -nostdinc -I ../include -ffreestanding
#CC=/home/bin/egcs/bin/gcc -c -O2 -Wall -ffreestanding -nostdinc -I ../include
#AR=ar rcs
LD=ld -nostdlib -r

OBJECT=callgate.o unistd.o fcntl.o stat.o dirent.o system.o signal.o wait.o

#********************************************* Make *****************************************************

all:posix.o


posix.o:$(addprefix $(BINDIR),$(OBJECT))
	$(LD) -o $@ $^

$(BINDIR)%.o:%.S
	$(CC) -o $@ $<

$(BINDIR)%.o:%.c
	$(CC) -o $@ $<


clean:
	rm -f $(BINDIR)*
	rm posix.o -f
