# Version 1.1  Makefile 1.3 93/06/09
#
# Makefile to compile and install srialpop
# the installation will place the program in the directory defined
# with symbol DEST, default the home directory of the user ${SRIALPOP}.
# Also a .hushlogin, .cshrc, .login and .profile are created there.
# The user ${SRIALPOP} is asumed to be configured to login with
# the program srialpop as "loginshell".

DEST=		/home/serpop
#DEST=		/usr/people/local/srialpop
SRIALPOP=	srialpop
GROUP=		guest

# use this on Convexes and Suns:
#DEFS=
#LDFLAGS=
# use this on Silicon Graphics IRIX systems:
#DEFS=	-DSYSV -ansi
#LDFLAGS= -lc_s -s
# use this on not above mentioned Unix System V (e.g. ULTRIX, SysV/68)
DEFS=	-DSYSV
LDFLAGS=

# On some systems it can be needed to enable or disable some
# tty-flags (e.g. X-on/X-off). This can be done by defining
# the symbol EXTRATTYFLAGS on the next line and writing code
# in routine extrattyflags situated in file srialpop.c just
# after the __STDC__ declarations.
# The code that is there now sets X-on/X-off, but will not
# be used since EXTRATTYFLAGS is not defined.
#CFLAGS=	-O ${DEFS} -DEXTRATTYFLAGS
CFLAGS=	-O ${DEFS}

srialpop:	srialpop.o
		${CC} $? ${LDFLAGS} -o $@

install:	srialpop
		strip srialpop
		mv srialpop ${DEST}
		chgrp ${GROUP} ${DEST}/srialpop
		chmod 511 ${DEST}/srialpop
		touch ${DEST}/.hushlogin
		echo "exit" > ${DEST}/.login
		-ln ${DEST}/.login ${DEST}/.cshrc
		-ln ${DEST}/.login ${DEST}/.profile
		rm -f ${DEST}/.forward
		chmod 644 ${DEST}/.hushlogin ${DEST}/.login

clean:
		rm -f core srialpop *.o srialpop.shar

shar:		srialpop.shar
		shar README Makefile srialpop.c > srialpop.shar

srialpop.shar:	README Makefile srialpop.c
