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

# if this doesn't work, try -DYOUROS, eg. -DLINUX, to fix things.
# if you want to log it all, add -DFACISCT
OTHER_CFLAGS = 

CC	  	= @CC@
INSTALL    	= @INSTALL@
BINRM		= @BINRM@
SOCKSFLAGS      = -DSOCKS  -DINCLUDE_PROTOTYPES
EXTRA_CFLAGS	=
LIBS            = -L../../lib -lsocks5 @LDFLAGS@ @EXPORT_LDFLAGS@ @LIBS@ 
CDEBUG_FLAGS	= @CDEBUG_FLAGS@
CFLAGS 		= -I../../include -I$(srcdir)/../../include @CFLAGS@ $(CDEBUG_FLAGS) $(SOCKSFLAGS) $(OTHER_CFLAGS) @FTPDEFS@ $(EXTRA_CFLAGS)

# Directory into which ftp program will be installed:
# Directory into which ftp's man page file will be installed:
BINDIR 		= $(exec_prefix)/bin
MANDIR    	= $(prefix)/man

#==============================================================================

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

PROG=	ftp
SRCS=	cmds.c cmdtab.c ftp.c glob.c main.c ruserpass.c domacro.c
OBJS=	cmds.o cmdtab.o ftp.o glob.o main.o ruserpass.o domacro.o

all: Makefile $(PROG)

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

$(PROG): $(OBJS) ../../lib/libsocks5.a
	$(CC) $(CFLAGS) -o $(PROG) $(OBJS) $(LIBS)

install: $(PROG)
	$(INSTALL) -m 111 $(PROG) $(BINDIR)/r$(PROG)

install.man: 
	$(INSTALL) -m 444 ftp.1 $(MANDIR)/man1

clean: 
	-$(BINRM) $(OBJS) $(PROG) core 

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

cmds.o: cmds.c
cmdtab.o: cmdtab.c
ftp.o: ftp.c
glob.o: glob.c
main.o: main.c
ruserpass.o: ruserpass.c
domacro.o: domacro.c
