/* Imakefile for XWAIS
 * Author: Jonny Goldman
 *
 */

VERSION = 0.86

TOP = ..

SRCDIR = $(TOP)/x
SUPDIR = $(TOP)/ir
UIDIR = $(TOP)/ui

/*
 For a smaller client, but with no local search,
 use this line this instead of the latter:
IR_LIB	= ../bin/client.a
*/
IR_LIB	= $(TOP)/bin/inv.a

PROTOCOL_LIB	= $(TOP)/bin/wais.a

LIBFTW = $(TOP)/bin/libftw.a

UI_LIB = $(IR_LIB) $(PROTOCOL_LIB) $(LIBFTW)

/*
 For the Motif version , add -lXm

 LOCAL_LIBRARIES = $(UI_LIB) -lXm $(XAWLIB) $(XTOOLLIB) $(XMULIB) $(XLIB)

*/


LOCAL_LIBRARIES = $(UI_LIB) $(XAWLIB) $(XTOOLLIB) $(XMULIB) $(XLIB)


/*
 For the openwin version version , add -I/usr/openwin/include

INCLUDES = -I$(SRCDIR) -I$(SUPDIR) -I$(UIDIR) -I/usr/openwin/include

*/


INCLUDES = -I$(SRCDIR) -I$(SUPDIR) -I$(UIDIR) -I/usr/openwin/include

/* for alternate font in text popup, add -DUSE_ALTFONT to CFLAGS (somehow) */

/* this is R5 only! */

EXTRA_DEFINES = -DUSE_ALTFONT

/*
 For the Motif version, add -DMOTIF and -D_NO_PROTO if your C compiler
 can't handle ANSI prototypes.  You may need to fiddle with the libraries
 to insure all symbols are defined (I did!).

 CDEBUGFLAGS = -g -Bstatic -DUSE_ALTFONT -DMOTIF -D_NO_PROTO

*/

CDEBUGFLAGS = -g

TOBJ =  xwais.o \
	display.o \
	tcommands.o \
	scommands.o

QOBJ =  xwaisq.o \
	qdisplay.o \
	text.o \
 	qcommands.o \
	filereq.o \
	scommands.o \
	catalog.o \
	myAsciiSink.o \
	myAsciiSrc.o \
 	$(TOP)/ui/question.o \
	$(TOP)/ui/document.o \
	$(TOP)/ui/wais-ui.o


OBJS =  MyList.o \
	util.o \
	$(TOP)/ui/source.o

XWAIS_OBJS = $(TOBJ) $(OBJS)
XWAISQ_OBJS = $(QOBJ) $(OBJS)

SYSLIBS = -lm -lc

XWAIS = xwais
XWAISQ = xwaisq

PROGRAMS = $(XWAIS) $(XWAISQ) Xwais

AllTarget($(PROGRAMS))

NormalProgramTarget($(XWAIS),$(XWAIS_OBJS),$(UI_LIB),$(LOCAL_LIBRARIES),$(SYSLIBS))
NormalProgramTarget($(XWAISQ),$(XWAISQ_OBJS),$(UI_LIB),$(LOCAL_LIBRARIES),$(SYSLIBS))

DATE=`date +%y%m%d.%T`

install:: all
	((test -f $(XAPPLOADDIR)/Xwais) && \
	  mv $(XAPPLOADDIR)/Xwais $(XAPPLOADDIR)/Xwais.$(DATE))

InstallAppDefaults(Xwais)

InstallProgram($(XWAIS), $(BINDIR))
InstallProgram($(XWAISQ), $(BINDIR))

Xwais.ad:	Xwais
	cp ./Xwais ./Xwais.ad

Xwais:	Xwais.raw
	./fixResources.sh Xwais

all:: Xwais

$(IR_LIB):
	(cd $(TOP)/ir;make ${IR_LIB})

$(PROTOCOL_LIB):
	(cd $(TOP)/ir;make ${PROTOCOL_LIB})

clean::
	$(RM) Xwais Xwais.ad Makefile *%

DependTarget()
