### Path settings
srcdir = .
top_srcdir = ../..
prefix = /usr
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sysconfdir = /etc
mandir = /usr/man

### Installation programs and flags
INSTALL = /bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL} -s
LN_S = ln -s
MKDIR = mkdir -p -m 755

### Compiler and link options
CC	= gcc
CFLAGS	= -O2 -march=i486 -mtune=i686
DEFS	= -DHAVE_CONFIG_H
CPPFLAGS = -I$(top_srcdir) -I$(srcdir) $(DEFS)  
LDFLAGS	=  
LIBS	= -lutil -lcrypt  -lssl -lcrypto



### Makefile rules - no user-servicable parts below

CHAT_OBJS = chat.o
CHAT_HDRS = ../../config.h
ALL = chat

all: $(ALL)

chat: $(CHAT_OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o chat $(CHAT_OBJS) $(LIBS)

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

clean:
	rm -f *~ *.o $(ALL) core

distclean: clean
	rm -f Makefile

install: chat
	$(MKDIR) $(DESTDIR)$(bindir)
	$(INSTALL_PROGRAM) chat $(DESTDIR)$(bindir)
	$(MKDIR) $(DESTDIR)$(mandir)/man1
	$(INSTALL) chat.man $(DESTDIR)$(mandir)/man1/chat.1

.PHONY: clean distclean install
