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

OBJECT=callgate.o unistd.o fcntl.o stdlib.o stdio.o string1.o string2.o stat.o dirent.o system.o

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

all:libc.a

libc.a:$(addprefix $(BINDIR),$(OBJECT))
	$(AR) $@ $^

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

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


clean:
	rm -f $(BINDIR)*
	rm libc.a -f
