#
#	@(#)Makefile	1.1	(Alex Crain) 6/20/89
#
# Makefile for user interface to the uipc loadable driver.
#
# copyright (c) 1989 Alex Crain
#

# CC=gcc
RM=/bin/rm
MV=/bin/mv
ECHO=/bin/echo
M4=/usr/bin/m4
SHELL=/bin/sh
GET=/usr/bin/get
CFLAGS= -O $(VFLAG)

SCCSDIR=../sccs/lib

#
# the various file catagories.
#
CALLS=xxx
SSUPPORT=syserr.o __cerror.o 
CSUPPORT=perror.o  select.o
CSOURCE=perror.c select.c
SCCSFILES=Makefile.m4 gencall.m4 generic.m4 sockpipe.m4\
syserr.s __cerror.s perror.c

all: Makefile.m4
	make libuipc.a CALLS="`m4 Makefile.m4`"

libuipc.a: $(CALLS) $(SSUPPORT) $(CSUPPORT)
	rm -f libuipc.a
	ar cq libuipc.a $(CALLS) $(SSUPPORT) $(CSUPPORT)

$(CALLS): ../sysconfig.m4 gencall.m4 generic.m4
	$(ECHO) "define(MYSELF,$@)" | $(M4) - gencall.m4 > tmp.s
	$(AS) -o $@ tmp.s
	$(RM) tmp.s

$(CSUPPORT): $(?:.o=.c)
	$(CC) $(CFLAGS) -c $(?:.o=.c)

$(SSUPPORT): $(?:.o=.s)
	$(AS) $(?:.o=.s)

$(SCCSFILES):
	$(GET) $(GFLAGS) -p $(SCCSDIR)/s.$@ > $@

depend:
	cat Makefile | sed -e "/^### DEPEND LINE/q" > Make.tmp
	$(CC) -I. -M $(SOURCES) >> Make.tmp
	$(MV) Make.tmp Makefile

clean:
	$(RM) -f libuipc.a *.o \#* *~ core


### DEPEND LINE --- do not delete! ###
