#
# Makefile for xvgopher.
#
# (c) Copyright 1993, San Diego State University -- College of Sciences
#       (See the COPYRIGHT file for more Copyright information)
#
# This makefile will work on standard Sun4 systems running SunOS 4.1.X
# and which have the Sun C++ compiler installed in /usr/lang
# If your configuration differs, you will have to modify the rest of this
# file.
#
# The directory the executable should be installed in
BINDIR	=	/usr/local/bin

#
# The directory where the man page should go
MANDIR	=	/usr/local/man

#
# The section to use for the man page.
MANSECT	=	l

#
# Compiler to use.  It has been tested with Sun C++ 2.0, g++ 2.3.3, and
# Sun C++ 3.0
#CCC	=	CC
#CCC	=	g++ -fno-strict-prototypes -w
CCC	=	/usr/local/lang/CC

#
# Flags for the compiler.  We use openwin for our X development, but
# the standard x11r5/xview3 will work just fine.
#
CCFLAGS	=	-I$(OPENWINHOME)/include -O

#
# I specified the openwin libraries specifically to get around some
# problems with people not mounting our x11r5 tree.  Using this overrides
# the LD_LIBRARY_PATH environment and makes the shared version work on
# all machines with openwin3
#
LDFLAGS	=	-g -L/usr/openwin/lib

#
# The makedepend looks in the 'standard' places for system include files.
# Well, Sun decided they weren't going to use the 'standard' places for
# their compilers, so we have to specifiy the actual path...  (Bogus!!!)
#
SYS_INCLUDES =	-I/usr/lang/SC1.0/include/CC
#SYS_INCLUDES =	-I/usr/local/gnu/lib/g++-include -I/usr/local/gnu/lib/gcc-lib/sparc-sun-sunos4.1.2/2.3.3/include

#
# Strangely enough xvgopher uses xview!!!
#
LIBS	=	-lxview -lolgx -lX11

#
# All the files which will end up with an object file.  (Can't just say
# all source files, because in C++ the headers can contain all kinds of
# source as well...)
#
SRCS	=	\
		Connection.cc \
		GWAbout.cc \
		GWBinary.cc \
		GWBookmarks.cc \
		GWDirectory.cc \
		GWDownload.cc \
		GWFile.cc \
		GWGopher.cc \
		GWImage.cc \
		GWIndex.cc \
		GWInfo.cc \
		GWList.cc \
		GWPref.cc \
		GWSound.cc \
		GWTelnet.cc \
		GWindow.cc \
		Gopher.cc \
		List.cc \
		Preferences.cc \
		Response.cc \
		cursor.cc \
		icons.cc \
		main.cc

#
# I am lazy.  I hate typing in lists into makefiles!  I think the word
# replacement macro in makefiles is the best thing since sliced cheese!
#
OBJS	=	$(SRCS:%.cc=%.o)

#
# The list of files to put in the shar archive
#
SHARFILES =	\
		README \
		COPYRIGHT \
		BUGS \
		TODO \
		Makefile \
		xvgopher.man \
		$(SRCS) \
		*.h \
		icons/*

TARGET	=	xvgopher

all:		$(TARGET)

$(TARGET):	$(OBJS)
	$(CCC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

static:		$(OBJS)
	$(CCC) $(LDFLAGS) -o $(TARGET).static $(OBJS) -Bstatic $(LIBS)

clean:
	rm -f $(OBJS) $(TARGET) *.bak *.BAK

#
# The installation of the program.
#
install: $(TARGET)
	install -s $(TARGET) $(BINDIR)
	install xvgopher.man $(MANDIR)/man$(MANSECT)/xvgopher.$(MANSECT)

#
# I use makedepend.  If you don't have it, get it!
#
depend:
	makedepend -- $(CCFLAGS) $(SYS_INCLUDES) -- $(SRCS)

#
# Create a shar file suitable for posting
#
shar:
	shar -c -o xvgopher.shar -l55 $(SHARFILES)

#
# Create some tar files suitable for ftping.
#
tar:
	gnutar czvf xvgopher.tar.z $(SHARFILES)
	gnutar cZvf xvgopher.tar.Z $(SHARFILES)

zeus:
	gnutar czvf /tmp/xvg.tar.Z *.cc *.h Makefile icons/*
	rcp /tmp/xvg.tar.Z zeus:
	rm /tmp/xvg.tar.Z

kiwi:
	gnutar czvf /tmp/xvg.tar.Z *.cc *.h Makefile icons/*
	rcp /tmp/xvg.tar.Z kiwi:
	rm /tmp/xvg.tar.Z

rohan:
	gnutar czvf /tmp/xvg.tar.Z *.cc *.h Makefile icons/*
	rcp /tmp/xvg.tar.Z rohan:
	rm /tmp/xvg.tar.Z

saturn:
	gnutar czvf /tmp/xvg.tar.Z *.cc *.h Makefile icons/*
	rcp /tmp/xvg.tar.Z saturn:
	rm /tmp/xvg.tar.Z
