#
# 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.
#
# 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
#
#
#ident	"@(#)Makefile	1.34	94/08/29 SMI"
#
# Copyright (c) 1993 by Sun Microsystems, Inc.
#
# lib/librpc/Makefile
#
LIBRARY= librpc.a
VERS = .1
PROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc

# objects are listed by source directory

DES=		des_crypt.o des_soft.o
NETDIR= netdir.o

NETSEL= getnetconfig.o getnetpath.o

RPC=  \
auth_des.o      auth_none.o     auth_sys.o      authdes_prot.o  authsys_prot.o \
clnt_bcast.o    clnt_bsoc.o     clnt_dg.o       clnt_generic.o  clnt_perror.o  \
clnt_raw.o      clnt_simple.o   clnt_vc.o       getdname.o      getrpcent.o \
auth_time.o \
inet_ntoa.o     key_call.o  \
key_prot.o      netname.o       netnamer.o      openchild.o     pmap_clnt.o  \
pmap_prot.o     port.o          rpc_callmsg.o   rpc_comdata.o   rpc_generic.o \
rpc_prot.o      rpc_soc.o       rpcb_clnt.o     rpcb_prot.o     rpcdname.o  \
rtime_tli.o     svc.o           svc_auth.o      svc_auth_sys.o  svc_dg.o  \
svc_generic.o   svc_raw.o       svc_run.o       svc_simple.o    svc_vc.o  \
svcauth_des.o   svcdesname.o    xdr.o           xdr_array.o     xdr_float.o  \
xdr_mem.o       xdr_rec.o       xdr_refer.o     xdr_sizeof.o    xdr_stdio.o \
ti_opts.o       svid_funcs.o    rpcb_st_xdr.o   rpc_sel2poll.o  rpc_td.o \
rpc_trace.o	\
mt_misc.o

RPC_DERIVED_FILES= \
	rpc/key_prot.c

GEN_DERIVED_FILES=

DERIVED_FILES= $(GEN_DERIVED_FILES) $(RPC_DERIVED_FILES)

#
# Make sure they get cleaned when necessary
#
CLEANFILES += $(DERIVED_FILES)

KEY= publickey.o xcrypt.o

OBJECTS= $(NETDIR) $(NETSEL) $(RPC) \
	 $(KEY)

# librpc build rules
objs/%.o profs/%.o pics/%.o: netdir/%.c
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

objs/%.o profs/%.o pics/%.o: netsel/%.c
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

objs/%.o profs/%.o pics/%.o: rpc/%.c
	$(COMPILE.c) -DPORTMAP -DNIS -o $@ $<
	$(POST_PROCESS_O)
         
objs/%.o profs/%.o pics/%.o: key/%.c
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

# include library definitions
include ../Makefile.lib

CPPFLAGS += -D_REENTRANT

LIBS += $(DYNLIB)

LDLIBS += -ldl -lc -lintl

RPCGEN += -C

.KEEP_STATE:

all: $(DERIVED_FILES) $(LIBS)

install: all $(ROOTLIBS) $(ROOTLINKS)

#
# Rules for building the derived files
#
# Derived header files
#

#
# Derived source files
#
rpc/key_prot.c: $(PROTOCOL_DIR)/key_prot.x
	$(RPCGEN) -c $(PROTOCOL_DIR)/key_prot.x |\
        sed -e 's!"$(PROTOCOL_DIR)/key_prot.h"!<rpc/key_prot.h>!' > $@

# include library targets
include ../Makefile.targ

