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

# ie; /usr/Xinu
DIR	=	../../..
LIB	=	$(DIR)/lib
#
BIN	=	/usr/local/32k/bin
#
RANTOUCH=	touch
AR	=	$(BIN)/ar
RANLIB	=	$(BIN)/ranlib
CC	=	$(BIN)/gcc
#
CFLAGS	=	-O -I$(DIR)/include -DNS32K

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 putchar.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		\
		memccpy.c memchr.c memcmp.c memcpy.c memset.c

OFILES	=	abs.o atoi.o atol.o				\
		ctype_.o					\
		doprnt.o doscan.o				\
		fgets.o fprintf.o fputs.o			\
		gets.o						\
		index.o						\
		printf.o putchar.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		\
		memccpy.o memchr.o memcmp.o memcpy.o memset.o


all:		libxc.a

install:	all
		cp libxc.a $(LIB)/libxc.a
		$(RANTOUCH) $(LIB)/libxc.a

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

libxc.a:	$(OFILES)
		rm -rf libxc.a
		$(AR) -a libxc.a $(OFILES)
		$(RANLIB) libxc.a
