#
# 5799-WZQ (C) COPYRIGHT = NONE
# LICENSED MATERIALS - PROPERTY OF IBM
#
# $Header:Makefile 12.0$ 
# $ACIS:Makefile 12.0$ 
# $Source: /ibm/acis/usr/src/lib/libc/net/yp/RCS/Makefile,v $ 
#
# Copyright (c) 1983 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#	@(#)Makefile	6.3 (Berkeley) 3/18/86
#

OBJS=	ether_addr.o getnetent.o getprotoent.o getrpcent.o getservent.o \
		getservbyname.o getservbyport.o

LINKS=	getservbyname.c getservbyport.c

SRCS=	ether_addr.c getnetent.c getprotoent.c getrpcent.c getservent.c \
	${LINKS}

CFLAGS= -O
DFLAGS=
TAGSFILE= tags
DESTDIR=

.c.o:
	${CC} -p -c ${CFLAGS} ${DFLAGS} $*.c
	-ld -X -r $*.o
	mv a.out profiled/$*.o
	${CC} ${CFLAGS} ${DFLAGS} -c $*.c
	-ld -x -r $*.o
	mv a.out $*.o

tablelib tablelib_p: ${SRCS} ${OBJS} 
	@echo "building profiled tablelib"
	@cd profiled; ar cru ../tablelib_p ${OBJS}
	@echo "building normal tablelib"
	@ar cru tablelib ${OBJS}

${LINKS}:
	ln -s ../$@
	
tags:
	cwd=`pwd`; \
	for i in ${SRCS}; do \
		ctags -a -f ${TAGSFILE} $$cwd/$$i; \
	done

clean:
	rm -f *.o errs a.out core tablelib tablelib_p profiled/*.o \
		tags Makefile.bak

co:
	co ${COFLAGS} ${SRCS}

ci:
	ci ${CIFLAGS} ${SRCS}

depend:
	for i in ${SRCS}; do \
	    cc -M ${CFLAGS} ${DFLAGS} $$i | awk ' { if ($$1 != prev) \
		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
		else rec = rec " " $$2 } } \
		END { print rec } ' >> makedep; done
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	cp Makefile Makefile.bak
	ed - Makefile < eddep
	rm eddep makedep
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see make depend above' >> Makefile

# DO NOT DELETE THIS LINE -- make depend uses it

ether_addr.o: ether_addr.c /usr/include/stdio.h /usr/include/sys/types.h
ether_addr.o: /usr/include/sys/socket.h /usr/include/net/if.h
ether_addr.o: /usr/include/net/if_arp.h /usr/include/netinet/in.h
ether_addr.o: /usr/include/netinet/if_ether.h
getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h
getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h ./../../yp/ypclnt.h
getnetent.o: /usr/include/netinet/in.h /usr/include/arpa/inet.h
getprotoent.o: getprotoent.c /usr/include/stdio.h /usr/include/sys/types.h
getprotoent.o: /usr/include/sys/socket.h /usr/include/netdb.h
getprotoent.o: ./../../yp/ypclnt.h
getrpcent.o: getrpcent.c /usr/include/stdio.h /usr/include/netdb.h
getrpcent.o: /usr/include/sys/types.h /usr/include/sys/socket.h
getrpcent.o: ./../../yp/ypclnt.h
getservent.o: getservent.c /usr/include/stdio.h /usr/include/sys/types.h
getservent.o: /usr/include/sys/socket.h /usr/include/netdb.h
getservent.o: ./../../yp/ypclnt.h

ether_addr.o: ether_addr.c /usr/include/stdio.h /usr/include/sys/types.h
ether_addr.o: /usr/include/sys/socket.h /usr/include/net/if.h
ether_addr.o: /usr/include/net/if_arp.h /usr/include/netinet/in.h
ether_addr.o: /usr/include/netinet/if_ether.h
getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h
getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h ./../../yp/ypclnt.h
getnetent.o: /usr/include/netinet/in.h /usr/include/arpa/inet.h
getprotoent.o: getprotoent.c /usr/include/stdio.h /usr/include/sys/types.h
getprotoent.o: /usr/include/sys/socket.h /usr/include/netdb.h
getprotoent.o: ./../../yp/ypclnt.h
getrpcent.o: getrpcent.c /usr/include/stdio.h /usr/include/netdb.h
getrpcent.o: /usr/include/sys/types.h /usr/include/sys/socket.h
getrpcent.o: ./../../yp/ypclnt.h
getservent.o: getservent.c /usr/include/stdio.h /usr/include/sys/types.h
getservent.o: /usr/include/sys/socket.h /usr/include/netdb.h
getservent.o: ./../../yp/ypclnt.h
getservbyname.o: getservbyname.c /usr/include/netdb.h
getservbyport.o: getservbyport.c /usr/include/netdb.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
