# Make file for rlogind directory
#
# Things you might want to change.  Pass them in on the command line:
# ROOT - should point to the root where the commands will be installed
#        (e.g. /deliver/INETSVCS/indnetwk)

ROOT=

PRODUCTS=/usr/lbin/rlogind

# Defaults file containing the shell, compiler options, etc
BUILDRULES=/source/INETSVCS/$(LOGNAME)/config/defaults

include ${BUILDRULES}

#INCLUDES=-I../../include -I/usr/include
INCLUDES= -I/usr/include
CCFLAGS=$(INCLUDES) -DAUDIT $(CFLAGS) -Ae   

OBJS=	rlogind.o rlogind_sec.o getstrpty.o 

SRCS=   rlogind.c rlogind_sec.c getstrpty.c 
KSRCS=rlogind_kerb.c
KOBJS=rlogind_kerb.o

LDLIBRARIES=  -lsec ../util/libutil.a
KLIBS=-lkrb5 -lisode -lcom_err -lcrypto ../kutil/libklib.a

#Install database name
INSTALLDB=/source/INETSVCS/$(LOGNAME)/config/installdb

#Script called to parse the install deliverable
INSTALLSCPT=/source/INETSVCS/$(LOGNAME)/config/install_script

default: all

all: clean build install

clean:
	$(RM) -f $(OBJS) $(KOBJS)
	$(RM) -f rlogind
	$(RM) -f krlogind
	
install:
	for file in $(PRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done

build: rlogind

rlogind:   $(SRCS)
	$(ECHO) "Building rlogind..."
	$(RM) -f $(OBJS) 
	$(CC) -c $(CCFLAGS) $(SRCS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBRARIES)

krlogind:   $(SRCS) $(KSRCS) 
	$(ECHO) "Building krlogind..."
	$(RM) -f $(OBJS) $(KOBJS)
	$(CC) -c -DKERBEROS $(CCFLAGS) $(SRCS) $(KSRCS) 
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(KOBJS) $(LDLIBRARIES) $(KLIBS)

