#
# xnetlib Imakefile
# Reed C. Wade
#
# $Id: Imakefile,v 1.4 1993/07/13 18:57:28 wade Exp $
# 
# $Log: Imakefile,v $
# Revision 1.4  1993/07/13  18:57:28  wade
# *** empty log message ***
#
# Revision 1.3  1993/07/07  20:12:34  wade
# more static targets
#
# Revision 1.2  1993/07/07  15:43:51  wade
# *** empty log message ***
#
# Revision 1.1  1993/07/07  15:34:11  wade
# Initial revision
#
# Revision 1.15  1993/06/16  15:00:11  wade
# added target std to generate Makefile.std from Imakefile
#
# Revision 1.14  1993/06/12  17:52:04  browne
# added files to CONFERENCE_SRC and CONFERENCE_OBJ
#
# Revision 1.13  1993/05/25  14:34:39  wade
# added conference discretionary symbols
#
# Revision 1.12  1993/05/20  12:09:12  browne
# added parse-date.c and parse-date.o
#
# Revision 1.11  1993/04/20  15:30:42  wade
# added CDEBUGFLAGS = -g
#
# Revision 1.10  1993/04/20  15:23:49  wade
# added konnekt
#
# Revision 1.9  1993/04/16  21:12:27  wade
# added database module
#
# Revision 1.8  1993/01/06  21:36:26  wade
# added distribution and rcs targets
#
# Revision 1.1  1993/01/06  21:35:22  wade
# Initial revision
#
# Revision 1.7  1993/01/06  20:34:28  wade
#
# Revision 1.6  1992/12/31  21:31:12  wade
#
# Revision 1.5  1992/12/31  21:30:03  wade
# improved comments
#

CDEBUGFLAGS = -g

DEPLIBS = XawClientDepLibs
LOCAL_LIBRARIES = XawClientLibs

# on Ultrix 4.2, you MUST have either the "Unsupported X11 Components"
# (U?XUNMIT420) or have MIT X11R4 or MIT X11R5 installed.  DecWindows
# alone is NOT sufficient.  If you have the DEC-supplied "Unsupported"
# package, the following include is needed; otherwise, it does no harm.
#
#EXTRA_INCLUDES=-I/usr/include/mit


# Performance Database Module
# Uncomment these 3 lines if you have the Performance Database Module
#
PERF_DEFS = -DPERFORMANCE
PERFORMANCE_SRC = performance.c
PERFORMANCE_OBJ = performance.o

# Conference Database Module (you don't have this yet)
CONF_DEFS = -DCONFERENCE
CONFERENCE_SRC = make_database.c do_database.c dbIncoming.c \
                 db_addconf.c db_descrecv.c database_read.c \
                 db_saves.c db_search.c db_submit.c \
                 db_utils.c database.c parse-date.c
CONFERENCE_OBJ = make_database.o do_database.o dbIncoming.o \
                 db_addconf.o db_descrecv.o database_read.o \
                 db_saves.o db_search.o db_submit.o \
                 db_utils.o database.o parse-date.o

# Uncomment this option if you are Steve Moulton. 
# His site is set up to use a shared index file database (see main.c).
#
# STEVE_DEFS = -DMOULTON

DEFINES = $(STEVE_DEFS) $(PERF_DEFS) $(CONF_DEFS)

SRCS =	main.c classi.c keyword.c library.c who.c \
	konnekt.c \
	filelist.c libselect.c classselect.c setup.c \
	fasthelp.c motd.c nl_access.c file_access.c \
	$(PERFORMANCE_SRC) \
	$(CONFERENCE_SRC) \
	GasGauge.c UtkasciiSink.c UtkasciiSrc.c UtkasciiText.c \
	receive.c index.c help.c state.c misc.c print.c contexthelp.c  \
	newwin.c 

OBJS =	main.o classi.o keyword.o library.o who.o \
	konnekt.o \
	filelist.o libselect.o  classselect.o setup.o \
	fasthelp.o motd.o  nl_access.o file_access.o \
	$(PERFORMANCE_OBJ) \
	$(CONFERENCE_OBJ) \
	GasGauge.o UtkasciiSink.o UtkasciiSrc.o UtkasciiText.o \
	receive.o index.o help.o state.o misc.o print.o contexthelp.o  \
	newwin.o 

ComplexProgramTarget(xnetlib)

netlibget: nl_access.c
	$(CC) -DSTANDALONE -o netlibget nl_access.c

distribution: clean
	/bin/rm -f RCS Makefile
	(cd ../..; shar -s xnetlib@cs.utk.edu xnetlib > xnetlib.shar )
	compress xnetlib.shar
	cp ../doc/README xnetlib.shar.Z ~anonftp/pub/xnetlib
	rcp ../doc/README xnetlib.shar.Z netlib2.cs.utk.edu:/netlib/xnetlib

rcs:
	ln -s /polar/homes/netlib/admin/src/xnetlib/src/RCS RCS

#
# freaky linker and machine specific flags for statically linked executables
#
sun4StaticThud: $(OBJS)
	cc -Bstatic -o xnetlib $(OBJS) -L/usr/local/X11R5/lib -lXaw -lXmu -lXt -lXext -lX11 -Bdynamic
	strip xnetlib
	mv xnetlib xnetlib.sun4
	compress xnetlib.sun4

alphaStaticHonk: $(OBJS)
	cc -s -non_shared -o xnetlib $(OBJS) -lXaw -lXmu -lXt -lXext -lX11 -call_shared
	mv xnetlib xnetlib.alpha
	compress xnetlib.alpha

pmaxStaticBetty: xnetlib
	strip xnetlib
	mv xnetlib xnetlib.pmax
	compress xnetlib.pmax

hpStaticAdder: $(OBJS)
	cc -s -Wl,-a,archive -o xnetlib $(OBJS) -lXaw -lXmu -lXt -lXext -lX11
	mv xnetlib xnetlib.hp9000
	compress xnetlib.hp9000

rs6000StaticAustin: $(OBJS)
	cc -bnso -o xnetlib $(OBJS) -L/usr/local/X11R5/lib -lXaw -lXmu -lXt -lXext -lX11 -bI:/lib/syscalls.exp
	strip xnetlib
	mv xnetlib xnetlib.rs6000
	compress xnetlib.rs6000

#
# produce a Makefile.std from the Imakefile for those w/out imake
std:
	echo "#" > Makefile.std
	echo "# xnetlib Makefile.std" >> Makefile.std
	echo "#" >> Makefile.std
	echo "# Only use this if you don't have imake (xmkmf) installed" >> Makefile.std
	echo "# " >> Makefile.std
	echo "# set XINC and XLD if your X include files or libraries" >> Makefile.std
	echo "# aren't in the default path" >> Makefile.std
	echo "#" >> Makefile.std
	echo "# XINC = /usr/local/X11R5/include" >> Makefile.std
	echo "# XLD = /usr/local/X11R5/lib" >> Makefile.std
	echo "" >> Makefile.std
	echo "" >> Makefile.std
	echo "# begin of included Imakefile" >> Makefile.std
	echo "" >> Makefile.std
	echo "all: xnetlib" >> Makefile.std
	sed -e '/^ComplexProgramTarget/ D' < Imakefile >> Makefile.std
	echo "" >> Makefile.std
	echo "# end of included Imakefile" >> Makefile.std
	echo "" >> Makefile.std
	echo "" >> Makefile.std
	echo "" >> Makefile.std
	echo "# You probably don't need to set this" >> Makefile.std
	echo "#CC = cc" >> Makefile.std
	echo "" >> Makefile.std
	echo "LIBS = -lXaw -lXmu -lXt -lXext -lX11" >> Makefile.std
	echo "CFLAGS = -g $$(DEFINES) $$(XINC)" >> Makefile.std
	echo "" >> Makefile.std
	echo "" >> Makefile.std
	echo "xnetlib: $$(OBJS)" >> Makefile.std
	echo "	$$(CC) -o xnetlib $$(OBJS) $$(XLD) $$(LIBS)" >> Makefile.std

