##
## settings
##
prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@
bindir=@bindir@
mandir=@mandir@

##
## autoconf
##
CPP=@CPP@
CXXCPP=@CXXCPP@
CC=@CC@
CXX=@CXX@
DEFS=-D_USAGI -DINET6 @DEFS@
CFLAGS=@CFLAGS@ $(DEFS)
CXXFLAGS=@CXXFLAGS@ $(DEFS)

LIBOBJS=@LIBOBJS@
LDFLASG=@LDFLAGS@
LIBS=@LIBS@

INSTALL=@INSTALL@
INSTALL_PROG=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_DIR=@INSTALL_DIR@

LN_S=@LN_S@

SUIDMODE=4755
USE_PAM=@USE_PAM@

##
## targets
##
TARGET = rlogind

OBJS = rlogind.o network.o auth.o
ifeq ($(USE_PAM),1)
OBJS+=sockconv.o
endif

all:	$(TARGET)

clean:
	-rm -f *.o $(TARGET)
distclean: clean
	-rm -f config.*
	-rm -f Makefile

install: all
	$(INSTALL_DIR) $(sbindir)
	$(INSTALL_PROG) -s -o root -m$(SUIDMODE) rlogind $(sbindir)/in.rlogind
	$(INSTALL_DIR) $(mandir)/man8
	$(INSTALL_DATA) rlogind.8 $(mandir)/man8
	$(LN_S) -f in.rlogind.8 $(mandir)/man8/rlogind.8

##
## dependencies
##
rlogind: $(OBJS)
	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@

rlogind.o: pathnames.h logwtmp.h rlogind.h version.h
logwtmp.o: logwtmp.h
auth.o network.o: rlogind.h

