#############################################################################
#
#        Copyright 1989, Xylogics, Inc.  ALL RIGHTS RESERVED.
#
# ALL RIGHTS RESERVED. Licensed Material - Property of Xylogics, Inc.
# This software is made available solely pursuant to the terms of a
# software license agreement which governs its use.
# Unauthorized duplication, distribution or sale are strictly prohibited.
#
# Makefile description:
#
#	Makefile for Expedited Remote Procedure Call Daemon
#
# Original Author:  Jonathan Taylor	Created on: 84/07/08
#
# Revision Control Information:
#
# $Header: /annex/release8.0/src/erpcd/RCS/Makefile,v 2.34.100.1 1994/04/12 10:54:23 defina Exp $
#
##############################################################################
#
# DATE:		$Date: 1994/04/12 10:54:23 $
# REVISION:	$Revision: 2.34.100.1 $
#

# Options which don't require the use of additional libraries or object
# files have been moved to acp_policy.h.

# Uncomment these lines to compile with the Security Dynamics SecurID (tm)
# user authentication routines.  This requires the sdclient.a library
# to be built and linked.
# 
# Uncomment the next 2 lines for ACE/Server v1.1
# SECURIDFLAG = -DSECURID_CARD -DACE1_1
# SECURIDFILES = ../sdclient/sdclient.a ../sdclient/sdconf.o
#
# Uncomment the next 2 lines for ACE/Server v1.2
# SECURIDFLAG = -DSECURID_CARD -DACE1_2
# SECURIDFILES = ../sdclient/sdiclient.a

# Uncomment these lines to compile with the trivial Kerberos 4 authentication
# routines.  This requires that you have Kerberos 4 installed in your 
# network and will link erpcd with the Kerberos library obj/lib/krb/libkrb.a
# and obj/lib/des/libdes.a.  Xylogics does not provide Kerberos sources.
# Note that you should modify the KERBEROSLIB and KERBINCLUDES defines to 
# point to the appropriate directories for your Kerberos installation.
# KERBEROSFLAG = -DKERBEROS
# KERBEROSLIB = /usr/kerberos/obj/lib/krb/libkrb.a /usr/kerberos/obj/lib/des/libdes.a
# KERBINCLUDES = -I/usr/kerberos/obj/include

EFILES = erpcd ch_passwd convert

all:
		make -f ../make.config -f Makefile ${EFILES}

remake:
		make clean
		make all

clean:
		make -f ../make.config -f Makefile cleanup

lint:
		make -f ../make.config -f Makefile lintup

# depend:
#		make -f ../make.config -f Makefile dependencies

ERPCFILES = erpcd.c bfs.c acp.c acp_rpc.c acp_lib.c acp_policy.c \
 	 getacpdial.c
ERPOFILES = erpcd.o bfs.o acp.o acp_rpc.o acp_lib.o acp_policy.o \
 	 getacpdial.o
COMCFILES = getacppw.c getacpuser.c 
COMOFILES = getacppw.o getacpuser.o 

CFILES =	${ERPCFILES} ch_passwd.c convert.c ${COMCFILES}
OFILES =	${ERPOFILES} ch_passwd.o convert.o ${COMOFILES}


ALLFLAGS =	${CFLAGS} ${USER_BFS} ${SECURIDFLAG} ${KERBEROSFLAG} \
		${KERBINCLUDES}

cleanup:
		${RM} -f ${EFILES} ${OFILES}

# dependencies:
#		mkdep ${ALLFLAGS} ${ERPCFILES} ${COMCFILES} \
#			../libannex/libannex.a ../netadm/netadm.a ${LIBFLAG}

.c.o:
	${CC} ${ALLFLAGS} -c $<

${OFILES}:	../make.config Makefile

erpcd:		${ERPOFILES} ${COMOFILES} ../libannex/libannex.a \
			${SECURIDFILES} ${KERBEROSLIB} ../netadm/netadm.a
		${CC} ${CFLAGS} -o erpcd ${ERPOFILES} ${COMOFILES} \
			../libannex/libannex.a ${SECURIDFILES} ${KERBEROSLIB} \
			../netadm/netadm.a ${LIBFLAG}

ch_passwd:	ch_passwd.o ${COMOFILES} ../libannex/libannex.a
		${CC} ${CFLAGS} -o ch_passwd ch_passwd.o ${COMOFILES} \
			../libannex/libannex.a ${LIBFLAG}

convert:	convert.o ${COMOFILES} ../libannex/libannex.a
		${CC} ${CFLAGS} -o convert convert.o ${COMOFILES} \
			../libannex/libannex.a ${LIBFLAG}

lintup:
		lint ${ALLFLAGS} ${ERPCFILES} ${COMCFILES}
		lint ${ALLFLAGS} ch_passwd.c ${COMCFILES}
		lint ${ALLFLAGS} convert.c ${COMCFILES}

../libannex/libannex.a:
		cd ../libannex; make -f ../make.config -f Makefile libannex.a

install:	all ${INSTALL_INITD}
		$(INSTALL) execsuid $(INSTALL_DIR) ch_passwd
		$(INSTALL) $(INSTALL_DIR) erpcd
		$(INSTALL) precious-data $(INSTALL_DIR) eservices

INITD = /etc/init.d
ANNEXINIT = annex-initd
STARTPREFIX = /etc/rc2.d/S82
STOPPREFIX = /etc/rc0.d/K09

install-initd:
	@echo "*** Installing init.d start and stop script ***" > /dev/tty
	$(INSTALL) sysexec $(INITD) $(ANNEXINIT)
	$(RM) -f /etc/rc[20].d/[SK][0-9][0-9]$(ANNEXINIT)
	ln $(INITD)/$(ANNEXINIT) $(STARTPREFIX)$(ANNEXINIT)
	ln $(INITD)/$(ANNEXINIT) $(STOPPREFIX)$(ANNEXINIT)

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

acp.o:	acp.c ../inc/config.h ../libannex/api_if.h \
	../inc/courier/courier.h ../inc/erpc/erpc.h acp.h \
	../libannex/srpc.h ../inc/port/port.h
acp_lib.o:	acp_lib.c ../inc/config.h ../libannex/api_if.h \
	../inc/port/install_dir.h acp.h ../libannex/srpc.h \
	acp_policy.h ../inc/port/port.h
acp_policy.o:	acp_policy.c ../inc/config.h ../inc/ashadow.h \
	../inc/port/install_dir.h acp.h ../libannex/srpc.h \
	acp_policy.h ../inc/erpc/netadmp.h ../inc/port/port.h
acp_rpc.o:	acp_rpc.c ../inc/config.h ../inc/courier/courier.h \
	acp.h ../libannex/srpc.h ../inc/port/port.h
bfs.o:	bfs.c ../inc/config.h ../libannex/api_if.h \
	../inc/courier/courier.h ../inc/erpc/erpc.h ../inc/erpc/bfs.h \
	acp_policy.h ../inc/port/port.h
ch_passwd.o:	ch_passwd.c ../inc/config.h ../inc/port/install_dir.h \
	acp_policy.h
convert.o:	convert.c ../inc/config.h ../inc/ashadow.h \
	../inc/port/install_dir.h acp_policy.h ../inc/port/port.h
erpcd.o:	erpcd.c ../inc/port/install_dir.h ../inc/config.h \
	acp_policy.h ../libannex/api_if.h ../inc/courier/courier.h \
	../inc/erpc/erpc.h ../inc/port/port.h
getacpdial.o:	getacpdial.c ../inc/config.h ../inc/port/install_dir.h \
	acp_policy.h ../inc/port/port.h
getacppw.o:	getacppw.c ../inc/config.h ../inc/ashadow.h \
	../inc/port/install_dir.h acp_policy.h ../inc/port/port.h
getacpuser.o:	getacpuser.c ../inc/port/port.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
