#
#   Sun RPC is a product of Sun Microsystems, Inc. and is provided for
#   unrestricted use provided that this legend is included on all tape
#   media and as a part of the software program in whole or part.  Users
#   may copy or modify Sun RPC without charge, but are not authorized
#   to license or distribute it to anyone else except as part of a product or
#   program developed by the user or with the express written consent of
#   Sun Microsystems, Inc.
#  
#   SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
#   WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
#   PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
#  
#   Sun RPC is provided with no support and without any obligation on the
#   part of Sun Microsystems, Inc. to assist in its use, correction,
#   modification or enhancement.
#
#   SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
#   INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
#   OR ANY PART THEREOF.
#
#   In no event will Sun Microsystems, Inc. be liable for any lost revenue
#   or profits or other special, indirect and consequential damages, even if
#   Sun has been advised of the possibility of such damages.
#
#   Sun Microsystems, Inc.
#   2550 Garcia Avenue
#   Mountain View, California  94043
#
#  @(#)Makefile	1.12 91/03/11 TIRPC 1.0; from 1.68 89/10/05 SMI
#
# Copyright (c) 1987, 1989, 1990 by Sun Microsystems, Inc.
#
# Makefile for name-to-address translation library
#
#       Note: this is the driver part of the library.  The real work
#       is done in one of the transport-specific modules, found in ../../n2a.
#
include ../Makefile.arch
include ../Makefile.master
CPPFLAGS = -I.. -I../../include -I../../sys -I../netsel -I../netdir
CFLAGS += $(CPPFLAGS)
LDFLAGS += -assert pure-text

HDRS =	netdir.h

SRCS =	netdir.c nd_comdata.c

OBJS = $(SRCS:%.c=$(VARIANT)/%.o)

.KEEP_STATE:

all : xall

xall : $$(LIBS)
$(LIBS) : symlink $$(VARIANT) $$(OBJS)

symlink:
	rm -rf strings;\
	ln -s ../strings strings

.INIT: $(HDRS)

install: $(HDRS)
	install -d -o bin -m 755 ${DESTDIR}/include
	install -m 444 $(HDRS) ${DESTDIR}/include

tags: $(SRCS) $(HDRS)
	ctags -tw $(SRCS) $(HDRS)

ref: tags
	sed 's,	/.*,,' tags | \
	awk ' { printf("%-26s%-16s%s\n", $$1, $$2, $$3) }' > ref

lint: $(SRCS) $(HDRS)
	$(LINT.c) $(SRCS) 

clean: master.clean

#
# For making a release of the user rpc code to the net, we attach
# a disclaimer to each file and remove the KERNEL portions.
# NOTE: unifdef does not understand the "defined(ident)" syntax,
# so be sure and do these parts by hand.
# Also, note that this Makefile is non-standard, and cannot be
# used as is for a distribution to non-Sun sites.
#
#DISTUSER= distuser
#${DISTUSER}: $(SRCS) $(HDRS) $(XFILES) disclaimer
#	-mkdir ${DISTUSER}
#	@for i in $(SRCS) $(HDRS) $(XFILES) ; do \
#		echo $$i; \
#		cp disclaimer ${DISTUSER}/$$i; \
#		chmod +w ${DISTUSER}/$$i; \
#		unifdef -UKERNEL $$i \
#		| sed -e "s,./. <> ./,," >> ${DISTUSER}/$$i; \
#	done

depend: $(SRCS) $(HDRS)
	@${CC} ${CFLAGS} -M ${SRCS} > makedep
	@echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
	@echo '$$r makedep' >>eddep
	@echo 'w' >>eddep
	@cp Makefile makefile.bak
	@ed - Makefile < eddep
	@rm eddep makedep makefile.bak

# DO NOT DELETE THIS LINE
netdir.o: netdir.c
netdir.o: /usr/include/stdio.h
netdir.o: /usr/include/sys/types.h
netdir.o: /usr/include/sys/stdtypes.h
netdir.o: /usr/include/sys/sysmacros.h
netdir.o: /usr/include/tiuser.h
netdir.o: ../netdir/netdir.h
netdir.o: ../netsel/netconfig.h
netdir.o: /usr/include/string.h
netdir.o: /usr/include/sys/stdtypes.h
netdir.o: /usr/include/sys/file.h
netdir.o: /usr/include/sys/types.h
netdir.o: /usr/include/sys/fcntlcom.h
netdir.o: /usr/include/sys/stdtypes.h
netdir.o: /usr/include/sys/stat.h
netdir.o: /usr/include/sys/types.h
netdir.o: /usr/include/dlfcn.h
nd_comdata.o: nd_comdata.c
nd_comdata.o: ../netdir/netdir.h
