srcdir 		= @srcdir@
VPATH 		= @srcdir@
prefix	        = @prefix@
exec_prefix	= @exec_prefix@

# LINUX
# OTHER_CFLAGS = -traditional -DLINUX  

CC  	        = @CC@
MAKED	        = @MAKED@
SOCKSFLAGS 	= -DSOCKS
CDEBUG_FLAGS	= @CDEBUG_FLAGS@
EXTRA_CFLAGS	=
CFLAGS	        = -I../../include -I$(srcdir)/../../include @CFLAGS@ $(CDEBUG_FLAGS) $(SOCKSFLAGS) ${OTHER_CFLAGS} -DORIG_FINGER=\"@ORIG_FINGER@\" -DINCLUDE_PROTOTYPES $(EXTRA_CFLAGS)
INSTALL	        = @INSTALL@
BINRM           = @BINRM@
LIBS            = -L../../lib -lsocks5 @LDFLAGS@ @EXPORT_LDFLAGS@ @LIBS@ 
BINDIR  	= $(exec_prefix)/bin
MANDIR  	= $(prefix)/man

# The Internet Whois server; used to be nic.ddn.mil.
WHOIS_SERVER	= -DWHOIS_SERVER'="rs.internic.net"'


.SUFFIXES: .c .o
.c.o:
	$(CC) ${CFLAGS} -c $(srcdir)/$*.c
#==============================================================================


SRC = finger.c

all: Makefile finger whois

Makefile: $(srcdir)/Makefile.in ../../config.status
	(cd ../..; CONFIG_FILES=clients/finger/Makefile CONFIG_HEADERS= ./config.status)

finger: $(srcdir)/$(SRC) ../../lib/libsocks5.a
	$(CC) $(CFLAGS) -o $@ $(srcdir)/$(SRC) $(LIBS)

whois: $(srcdir)/$(SRC) ../../lib/libsocks5.a
	$(CC) $(WHOIS_SERVER) $(CFLAGS) -o $@ $(srcdir)/$(SRC) $(LIBS)

install: finger whois
	$(INSTALL) -m 111 finger $(BINDIR)/rfinger
	$(INSTALL) -m 111 whois $(BINDIR)/rwhois

install.man: 
	$(INSTALL) -m 444 ../doc/finger.1 $(MANDIR)/man1
	$(INSTALL) -m 444 ../doc/whois.1 $(MANDIR)/man1

clean: 
	-$(BINRM) whois finger core

distclean: clean
	-$(BINRM) Makefile *~ #*# *.bak

finger.o: finger.c
