# Make file for remsh 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/bin/remsh /usr/bin/rexec

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

include ${BUILDRULES}

INCLUDES=-I/usr/include -I../kutil
CCFLAGS=$(INCLUDES) -DAUDIT -DHP_NFS $(CFLAGS)   

OBJS=   remsh.o 
SRCS=   remsh.c  

KLIBS=-lkrb5 -lisode -lcom_err -lcrypto ../kutil/libklib.a
LDLIBRARIES=    ../util/libutil.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)
	$(RM) -f kremsh remsh
	
install:
	for file in $(PRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done

build: remsh 

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

kremsh : $(SRCS)  ../kutil/libklib.a
	 $(ECHO) "Building kremsh..."
	 $(RM) -f $(OBJS) 
	 $(CC) -c $(CCFLAGS) -Ae -DKERBEROS  $(SRCS) 
	 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBRARIES) $(KLIBS)

rexec: remsh
