OFILES= batch.o button_funcs.o change_dir.o create_main.o create_other.o \
	dircache.o dirlist.o dofuncs.o dnd.o event.o ftp.o host_list.o \
	lex.o main.o menu_funcs.o misc.o readdir.o schedule.o tar_view.o \
	transfer.o view_file.o

CFILES= batch.c button_funcs.c change_dir.c create_main.c create_other.c \
	dircache.c dirlist.c dofuncs.c dnd.c event.c ftp.c host_list.c \
	lex.l main.c menu_funcs.c misc.c readdir.c schedule.c tar_view.c \
	transfer.c view_file.c

ICONS= busy1.ftptool.icon busy2.ftptool.icon busy3.ftptool.icon \
	busy4.ftptool.icon ftptool.icon tar.viewer.icon

SUBHEADERS= batch.h batch_struct.h button_funcs.h change_dir.h config.h \
	create_main.h create_other.h dircache.h dircache_struct.h dirlist.h \
	dirlist_struct.h dofuncs.h dnd.h event.h ftp_var.h host_list.h \
	host_list_struct.h main.h menu_funcs.h misc.h patchlevel.h readdir.h \
	schedule.h schedule_struct.h tar_view.h transfer.h view_file.h \
	view_file_struct.h

HEADERS= ftptool.h

#Uncomment the following if ftptool should use the resolver only.
#to make sure the static ftptool can use the resolver
RES= -lresolv
SOCKS_LIB = ../lib/libsocks.a

#Uncomment if OPENWINHOME is not set
#OPENWINHOME=/usr/openwin

#Uncomment the appropriate one if necessary. You should not need
#either, as it should be determined by the program.
XVIEW= -DXVIEW3
#XVIEW= -DXVIEW2

#Uncomment the following lines for SunOS 4.X
#Remove the -Bstatic if you are going to run the 4.X ftptool
# under 5.X in compatibility mode (or better yet, recompile it
# for 5.X)
LIBS= $(SOCKS_LIB) -Bstatic -L$$OPENWINHOME/lib -lxview -lolgx -lX11 -Bdynamic $(RES) -lm
DEFINES= $(XVIEW)
#Choose a CC. Any CC (only tested under cc and gcc though)
CC=cc 
#CC=gcc -ansi 

#Uncomment the following lines for SunOS 5.0 with Sun cc.
#DEFINES= -DSYSV -DSVR4 $(XVIEW)
#LIBS= -R /usr/openwin/lib:/opt/openwin/lib:/usr/opt/openwin/lib \
#	-L${OPENWINHOME}/lib -lxview -lolgx -lX11 -lsocket -lnsl -lm
#CC=cc -Xa

#Uncomment the following lines for SunOS 5.0 with gcc
#Don't use -ansi, there seems to be a header file problem with that.
#DEFINES= -DSYSV -DSVR4 $(XVIEW)
#LIBS= -L${OPENWINHOME}/lib -lxview -lolgx -lX11 -lsocket -lnsl -lm
#CC=gcc 

#Uncomment the following line for 386 SVR4.
#DEFINES= -DSYSV -DSVR4 -DSYSV386

CFLAGS= -I$$OPENWINHOME/include  -O $(DEFINES) -g

BINDIR=/usr/local/Xbin
HELPDIR=$$OPENWINHOME/lib/help
MANDIR=/usr/local/man
MANSECT=1

#BINDIR=/net/enterprise/export/local/Xbin
#HELPDIR=/net/enterprise/export/unbundled/OW3/lib/help
#MANDIR=/net/enterprise/export/local/man
#MANSECT=1

rftptool: $(OFILES)
	$(CC) -o rftptool $(OFILES) $(STATIC) $(LIBS)

$(OFILES): $(HEADERS) $(SUBHEADERS) $(ICONS) Makefile

lint:
	/usr/bin/lint -DLINT -I$$OPENWINHOME/include $(CFILES)

vgrind:
	vgrind $(CFILES) -s11 -t | lpr -t

clean:
	rm -f $(OFILES) rftptool

install: rftptool
	install rftptool $(BINDIR)
	install ftptool.info $(HELPDIR)
	install ftptool.man $(MANDIR)/man$(MANSECT)/ftptool.$(MANSECT)
