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

#Assign OPENWINHOME such that OPENWINHOME/lib contains libxview.a and libolgx.a
OPENWINHOME=/comma_soft_3/xview3

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

LIBS= -L$$OPENWINHOME/lib -lxview -lolgx -lX11 -lm
DEFINES= $(XVIEW)
#Choose a CC. Any CC (only tested under cc and gcc though)
#c89 doesn't work
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

#include R4 X11 headers - should be in sub-directory X11 of one named here
CFLAGS= -I/comma_soft/usr/include -I$$OPENWINHOME/include  -O $(DEFINES)

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

ftptool: $(OFILES)
	$(CC) -o ftptool $(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) ftptool

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