top_srcdir=		@top_srcdir@
srcdir=			@srcdir@
VPATH=			@srcdir@
INSTALL=		@INSTALL@
INSTALL_PROGRAM=	@INSTALL_PROGRAM@

top_builddir= ..
include $(top_builddir)/Makefile.config

OBJS=		Display.o DocMatch.o ResultList.o ResultMatch.o \
		Template.o TemplateList.o WeightWord.o htsearch.o \
		parser.o

FOBJS=		$(top_builddir)/htfuzzy/libfuzzy.a
TARGET=		htsearch
LOCAL_DEFINES=	-DCONFIG_DIR=\"$(CONFIG_DIR)\"

all:	$(TARGET)

$(TARGET):	$(OBJS) $(FOBJS) $(HTLIBS)
	$(CXX) -o $(TARGET) $(LDFLAGS) $(OBJS) $(FOBJS) $(LIBS)

install:	all
	transform=@program_transform_name@
	$(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(CGIBIN_DIR)/`echo $(TARGET) | sed '$(transform)'`

clean:
	rm -f $(OBJS) $(TARGET) *~ *.bak *% core *.orig a.out

mostlyclean:	clean

distclean:	clean
	rm -f Makefile *.proj

depend:
	$(MAKEDEPEND) @CPPFLAGS@ $(CXXFLAGS) $(INCS) -- $(OBJS)

htsearch.o:		$(top_builddir)/CONFIG
