# POSIX P1003.1 compatability

SHELL = /bin/sh

# This is for the sun386i your mileage may vary :-)
#CC=gcc -ansi -Dsun386 -Dsun -Di386

CONFIG = -D_SYSV
#CONFIG = -D_BSD

LN = ln
#RANLIB = ranlib		# For BSD systems
RANLIB = echo Updated

LIB = libposix.a
INCL = ../h

CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)

MISC =	Makefile 
HDRS =	io.h wait.h times.h unistd.h fcntl.h dirent.h 
SRCS =	unistd.c fcntl.c times.c dup2.c
OBJS =	unistd.o fcntl.o times.o dup2.o

all:	$(LIB)

link:	$(HDRS)
	[ -d $(INCL) ] || mkdir $(INCL)
	[ -d $(INCL)/sys ] || mkdir $(INCL)/sys
	-$(LN) wait.h time.h times.h $(INCL)/sys
	-$(LN) io.h fcntl.h unistd.h $(INCL)
	-if [ ! -r /usr/include/unistd.h ]; then $(LN) dirent.h $(INCL); fi

$(LIB):	$(OBJS)
	ar r $@ $?
	$(RANLIB) $@

clean:
	-rm -f *.o *.out

clobber: clean
	-rm -f $(LIB)

fcntl.o: fcntl.h 

times.o: times.h 
