
#
#  Make the Xinu version of the C run-time support library
#

DIR	=	/usr/ftp/pub/Xinu.8086
LIB	=	$(DIR)/lib
AR	=	/bin/ar
AS	=	$(DIR)/bin/as86
AFLAGS	=
CC	=	$(DIR)/bin/cc86
CFLAGS	=	-c
RANLIB	=	$(DIR)/bin/ranlib86
LORDER  =	$(DIR)/bin/lorder86

.c.o:
		$(CC) $(CFLAGS) $<


SFILES 	=	arith.s

CFILES	=	abs.c atoi.c atol.c				\
		ctype_.c					\
		doprnt.c doscan.c				\
		fgets.c fprintf.c fputs.c			\
		gets.c						\
		index.c						\
		printf.c puts.c					\
		qsort.c						\
		rand.c rindex.c					\
		scanf.c sprintf.c				\
		strcat.c strcmp.c strcpy.c strlen.c		\
		strncat.c strncmp.c strncpy.c swab.c

OFILES	=	abs.o arith.o atoi.o atol.o	\
		ctype_.o				\
		doprnt.o doscan.o				\
		fgets.o fprintf.o fputs.o			\
		gets.o						\
		index.o						\
		printf.o puts.o					\
		qsort.o						\
		rand.o rindex.o					\
		scanf.o sprintf.o				\
		strcat.o strcmp.o strcpy.o strlen.o		\
		strncat.o strncmp.o strncpy.o swab.o


all:		libxc86.a

install:	all
		cp libxc86.a $(LIB)/libxc86.a
		$(RANLIB) $(LIB)/libxc86.a

clean:
		rm -rf *.o core a.out libxc86.a

libxc86.a:	$(OFILES)
		rm -rf libxc86.a
		$(AR) cr libxc86.a `$(LORDER) $(OFILES) | tsort`
		$(RANLIB) libxc86.a
