#
# |-----------------------------------------------------------|
# | Copyright (c) 1991, 1990 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 252.227-7013.  |
# |         MIPS Computer Systems, Inc.                       |
# |         950 DeGuigne Avenue                               |
# |         Sunnyvale, California 94088-3650, USA             |
# |-----------------------------------------------------------|
#
# $Header: Makefile,v 1.5.2.1 92/06/24 13:58:03 marker Exp $

SHELL=	/bin/sh
ETCDIR=	/etc

DESTROOT=

MAXOPT=	-O2
INCLUDE=-I../include
CFLAGS=	$(GNUM) -systype sysv $(MAXOPT) $(INCLUDE) $(ECFLAGS)
ASFLAGS=$(GNUM) -systype sysv -D__cerror=__aio_cerror $(EASFLAGS)
LFLAGS=	$(ELFLAGS)
YFLAGS=	$(EYFLAGS)

AR=	ar
ARFLAGS= crs

CRTSRC=__cerror.s

CRTOBJ=__cerror.o

ASRCS=	aread.s areadv.s awrite.s awritev.s listio.s acancel.s \
	astatus.s await.s

OBJS = $(ASRCS:.s=.o)

HDRS=

WHOAMI=	libaio.a

WHEREIGO= $(DESTROOT)/usr/svr3/usr/lib

INSTALL	=$(ETCDIR)/mipsinstall
MODE	=444
OWNER	=bin
GROUP	=bin
ICOPY	=-c
INSTOPTS=$(ICOPY) -m $(MODE) -o $(OWNER) -g $(GROUP)

all: $(WHOAMI)

install: $(WHOAMI)
	$(INSTALL) $(INSTOPTS) $(WHOAMI) $(WHEREIGO)

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

clean:
	-rm -f $(OBJS) $(CRTSRC) $(CRTOBJ)

clobber: clean
	-rm -f $(WHOAMI)

generic:
	$(GENERIC) -s $(ASRCS) $(CRTSRC) -h $(HDRS) -o $(OBJS) $(CRTOBJ) \
		 -p $(WHOAMI) $(INCLUDE) -R$(DESTROOT) -D$(WHEREIGO)

$(CRTSRC):
	[ ! -r $@ ] || rm -f $@
	ln -s ../libc/crt.mips/$@ $@
