#
# 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.15 91/03/11 TIRPC 1.0; from 1.68 89/10/05 SMI
#
# Copyright (c) 1987, 1989, 1990 by Sun Microsystems, Inc.
#

# Makefile for network selection library

#
# Sources in this package.
#	getnetconfig.c
#	getnetpath.c
#
# Headers included in component head.usrs:
# HDRS = netconfig.h
#       and temporarily netdir.h
#

include ../Makefile.arch
include ../Makefile.master
CPPFLAGS = -I.. -I../../include
CFLAGS += $(CPPFLAGS)
LDFLAGS += -assert pure-text

HDRS =	netconfig.h

SRCS =	getnetconfig.c getnetpath.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
getnetconfig.o: getnetconfig.c
getnetconfig.o: /usr/include/stdio.h
getnetconfig.o: /usr/include/errno.h
getnetconfig.o: /usr/include/sys/errno.h
getnetconfig.o: ./netconfig.h
getnetpath.o: getnetpath.c
getnetpath.o: /usr/include/stdio.h
getnetpath.o: /usr/include/errno.h
getnetpath.o: /usr/include/sys/errno.h
getnetpath.o: ./netconfig.h
