#
# |-----------------------------------------------------------|
# | Copyright (c) 1991 MIPS Computer Systems, Inc.            |
# | All Rights Reserved                                       |
# |-----------------------------------------------------------|
# |          Restricted Rights Legend                         |
# | Use, duplication, or disclosure by the Government is      |
# | subject to restrictions as set forth in                   |
# | subparagraph (c)(1)(ii) of the Rights in Technical        |
# | Data and Computer Software Clause of DFARS 52.227-7013.   |
# |         MIPS Computer Systems, Inc.                       |
# |         928 Arques Avenue                                 |
# |         Sunnyvale, CA 94086                               |
# |-----------------------------------------------------------|
#
# $Header: Makefile,v 1.3.1.1 92/06/24 14:10:25 marker Exp $

SHELL	=/bin/sh
ETCDIR	=/etc

DESTROOT=

MAXOPT	=-O2
INCLUDE	=-I../../inc -I../../../libc/include
CFLAGS	=$(GNUM) -systype svr3 $(MAXOPT) $(INCLUDE) $(ECFLAGS)
ASFLAGS =$(GNUM) -systype svr3 $(EASFLAGS)
LFLAGS	=$(ELFLAGS)
YFLAGS	=$(EYFLAGS)

AR = ar
ARFLAGS	=crs

OBJS	=doprnt.o	fprintf.o	scanf.o \
	 doscan.o	printf.o	sprintf.o \
	 lldivremi.o	llshifti.o

SRCS	=doprnt.c	fprintf.c	scanf.c \
	 doscan.c	printf.c	sprintf.c

HDRS	=print.h lldefs.h

LIBCSRCS = lldivremi.s llshifti.c
LIBCPATH = ../../../libc/gen.mips

WHOAMI	=libw_formatio.port.a
INTEGDIR=../../libw

all install: $(INTEGDIR)/$(WHOAMI)

$(INTEGDIR)/$(WHOAMI): $(WHOAMI)
	-rm -f $(INTEGDIR)/$(WHOAMI)
	cp $(WHOAMI) $(INTEGDIR)

$(WHOAMI): $(OBJS)
	-rm -f $(WHOAMI)
	$(AR) $(ARFLAGS) $(WHOAMI) $(OBJS)

clean:
	-rm -f $(OBJS)

clobber: clean
	-rm -f $(WHOAMI)

generic:
	$(GENERIC) -s $(SRCS) -h $(HDRS) -o $(OBJS) -p $(WHOAMI) \
		$(INCLUDE) -R$(DESTROOT) -D$(INTEGDIR)

doprnt.o: doprnt.c print.h
	$(CC) -c $(CFLAGS) -Olimit 640 doprnt.c

$(LIBCSRCS):    $(LIBCPATH)/$@
	[ ! -r $@ ] || rm -f $@
	ln -s $(LIBCPATH)/$@ $@
