# $Id: Makefile,v 1.7 1995/04/18 21:24:11 jdd Exp $
CC = gcc # C compiler. eg "cc" or "gcc"
RM = /bin/rm -rf
INSTALL = /usr/bin/install # BSD-style install program. 

# For DEFS, specify -DUSE_SYSLOG if you want diagnostics to be
# reported via the syslog(3) facility.  Otherwise, agetty will report its
# problems to /dev/console.
#
# Specify -DSOLARIS if compiling under Solaris 2.x
#
# Specify -SSUNOS if compiling under SunOS 4.1.x
#
# Specify -DDIGI_EXT_BAUDS for proprietary high baud rate support
# w/Digi EtherLite and SCSI Terminal Server modules.
# This support is transparent for non-Digi hardware.
#
DEFS = -DUSE_SYSLOG -DDEF_ERASE=BS

CFLAGS	= -O $(DEFS) # Or use -g for debugging

LDFLAGS =  # flags to linker

ETCDIR = /sbin # where agetty is installed

IFLAGS = -s -m 755 -o administrator -g administrators # agetty install flags

MANDIR = /usr/man/man8 # Man directory

IMFLAGS = -m 644 -o administrator -g administrators # man page install flags

LINTFLAGS = $(DEFS) -ha 

# end of user-configurable options

SRCS = agetty.c
OBJS = $(SRCS:.c=.o)

all:: agetty

agetty: $(OBJS)
	$(RM) $@
	$(CC) $(LDFLAGS) -o $@ $(OBJS)

lint:
	lint $(LINTFLAGS) $(SRCS)

lintport:
	lint -p $(LINTFLAGS) $(SRCS)

clean:
	$(RM) $(OBJS) agetty.exe

install: agetty
	$(INSTALL) $(IFLAGS) agetty $(ETCDIR) 

install.man: agetty.8
	$(INSTALL) $(IMFLAGS) agetty.8 $(MANDIR)

shar:	
	shar COPYRIGHT MANIFEST README patchlevel.h Makefile agetty.8 \
	agetty.c ttyclean cd_ext.h Users_Guide >agetty.shar
