Index: gsdl/trunk/src/oaiservr/Makefile.in
===================================================================
--- gsdl/trunk/src/oaiservr/Makefile.in	(revision 15455)
+++ gsdl/trunk/src/oaiservr/Makefile.in	(revision 15457)
@@ -6,5 +6,5 @@
 # University of Waikato, New Zealand.
 #
-# Copyright (C) 1999,2005  The New Zealand Digital Library Project
+# Copyright (C) 1999-2008  The New Zealand Digital Library Project
 #
 #
@@ -25,143 +25,141 @@
 ###########################################################################
 
-# set by configure for each makefile (for vpath etc)
-srcdir = @srcdir@
-gs_srcdir = $(srcdir)/../../src
-recpt_srcdir = $(gs_srcdir)/recpt
-colserv_srcdir = $(gs_srcdir)/colservr
-
-INDEXERS_DIR=../../indexers
+GSDL_DIR = ../..
+INDEXERS_DIR = $(GSDL_DIR)/indexers
+COLSERVR_DIR = $(GSDL_DIR)/src/colservr
+PROTOCOL_DIR = $(GSDL_DIR)/src/protocol
+RECPT_DIR = $(GSDL_DIR)/src/recpt
 
 ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
 ifeq ($(ENABLE_ACCENTFOLD), 1)
-AFLIBS = $(INDEXERS_DIR)/packages/unac/libunac.a 
-AFFLAGS = -DENABLE_ACCENTFOLD
+ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a 
 else
-AFLIBS = 
-AFFLAGS = 
+ACCENTFOLD_LIBS = 
 endif
 
-AR = ar
 CPP = @CXX@
+CPPFLAGS = @CXXFLAGS@
+INCLUDES = -I$(GSDL_DIR)/lib -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) -I$(RECPT_DIR) -I$(INDEXERS_DIR)/mgpp/text
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@ @GDBM_LIBPATH@ -lgdbm -L$(GSDL_DIR)/packages/expat/lib -lexpat $(ACCENTFOLD_LIBS)
 INSTALL = @INSTALL@
 
-CXXFLAGS = $(AFFLAGS) @CXXFLAGS@
-EXEEXT = @EXEEXT@
+CPPCOMPILE = $(CPP) -c $(CPPFLAGS) $(INCLUDES)
+CPPLINK = $(CPP) $(LDFLAGS) -o $@
 
 
-# -I../../packages/mg -I../../packages/mg/lib -I../../packages/mg/src/text ?
-INCLUDES = -I$(srcdir)/../../lib -I$(colserv_srcdir) -I$(INDEXERS_DIR)/mgpp/lib -I$(INDEXERS_DIR)/mgpp/text -I$(recpt_srcdir)
+.SUFFIXES:
+.SUFFIXES: .cpp .o
+.cpp.o:
+	$(CPPCOMPILE) -o $@ $< 
 
 
-LDFLAGS = @LDFLAGS@
-# need this for linking against recpt/infodbclass.o etc
-GDBM_LIBS=@GDBM_LIBPATH@ -lgdbm
-LIBS = $(GDBM_LIBS) $(AFLIBS) @LIBS@ -L../../packages/expat/lib -lexpat
+COLSERVR_OBJECTS = \
+	$(COLSERVR_DIR)/comtypes.o \
+	$(COLSERVR_DIR)/mgq.o \
+	$(COLSERVR_DIR)/search.o \
+        $(COLSERVR_DIR)/mgsearch.o \
+        $(COLSERVR_DIR)/querycache.o \
+        $(COLSERVR_DIR)/queryinfo.o \
+        $(COLSERVR_DIR)/collectserver.o \
+        $(COLSERVR_DIR)/colservrconfig.o \
+        $(COLSERVR_DIR)/maptools.o \
+        $(COLSERVR_DIR)/filter.o \
+        $(COLSERVR_DIR)/source.o \
+        $(COLSERVR_DIR)/browsefilter.o \
+        $(COLSERVR_DIR)/queryfilter.o \
+        $(COLSERVR_DIR)/gdbmsource.o \
+        $(COLSERVR_DIR)/mggdbmsource.o \
+        $(COLSERVR_DIR)/phrasesearch.o \
+        $(COLSERVR_DIR)/phrasequeryfilter.o \
+	$(COLSERVR_DIR)/mgqueryfilter.o \
+	$(COLSERVR_DIR)/mgppsearch.o \
+	$(COLSERVR_DIR)/mgppqueryfilter.o \
+	$(COLSERVR_DIR)/collectset.o \
+	$(COLSERVR_DIR)/lucenesearch.o \
+	$(COLSERVR_DIR)/lucenequeryfilter.o \
+	$(COLSERVR_DIR)/lucenegdbmsource.o \
+	$(COLSERVR_DIR)/expat_resultset.o \
+	$(COLSERVR_DIR)/expat_document.o
+
+PROTOCOL_OBJECTS = \
+	$(PROTOCOL_DIR)/nullproto.o \
+	$(PROTOCOL_DIR)/recptproto.o
+
+RECPT_OBJECTS = \
+	$(RECPT_DIR)/cgiargs.o \
+	$(RECPT_DIR)/cgiutils.o \
+	$(RECPT_DIR)/htmlutils.o \
+	$(RECPT_DIR)/recptprototools.o
+
+SOURCES = \
+	abstractlistaction.cpp \
+	dublincore.cpp \
+	identityaction.cpp \
+	listidsaction.cpp \
+	listrecsaction.cpp \
+	listsetsaction.cpp \
+	metaformat.cpp \
+	metaformatsaction.cpp \
+	oaiaction.cpp \
+	oaiargs.cpp \
+	oaiconfig.cpp \
+	oaidispatcher.cpp \
+	oaimain.cpp \
+	oaitools.cpp \
+	recordaction.cpp \
+	resumptiontoken.cpp \
+	rfc1807.cpp
+
+OBJECTS = \
+	abstractlistaction.o \
+	dublincore.o \
+	identityaction.o \
+	listidsaction.o \
+	listrecsaction.o \
+	listsetsaction.o \
+	metaformat.o \
+	metaformatsaction.o \
+	oaiaction.o \
+	oaiargs.o \
+	oaiconfig.o \
+	oaidispatcher.o \
+	oaimain.o \
+	oaitools.o \
+	recordaction.o \
+	resumptiontoken.o \
+	rfc1807.o
+
+GSDL_LIBS = \
+	$(GSDL_DIR)/lib/gsdllib.a  \
+	$(INDEXERS_DIR)/mg/src/text/libmgtext.a \
+	$(INDEXERS_DIR)/mg/lib/libmglib.a \
+	$(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
+	$(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
+
+EXEC_OBJECTS = \
+	$(OBJECTS) \
+	$(RECPT_OBJECTS) \
+	$(PROTOCOL_OBJECTS) \
+	$(COLSERVR_OBJECTS) \
+	$(GSDL_LIBS)
+
+EXEC = oaiserver
 
 
-CXXCOMPILE = $(CPP) -c $(CXXFLAGS) $(INCLUDES)
-CXXLINK = $(CPP) $(LDFLAGS)
-
-EXEC = oaiserver$(EXEEXT)
+oaiserver: $(EXEC_OBJECTS)
+	$(CPPLINK) $(EXEC_OBJECTS) $(LIBS)
 
 all: $(EXEC)
 
-# needed to clear builtin rules?
-#.SUFFIXES:
-
-.SUFFIXES: .cpp .o
-.cpp.o:
-	$(CXXCOMPILE) -o $@ $< 
-
-
-COMMONHEADERS = oaiargs.h oaiaction.h oaidispatcher.h oaiconfig.h identityaction.h recordaction.h \
-                listrecsaction.h listidsaction.h listsetsaction.h metaformatsaction.h oaitools.h \
-                abstractlistaction.h metaformat.h dublincore.h rfc1807.h resumptiontoken.h
-
-ifeq ($(USE_CORBA), 1)
-LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h corbaproto.h
-else
-LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h
-endif
-
-HEADERS = $(COMMONHEADERS) $(LIBRARYHEADERS)
-
-
-COMMONSOURCES = oaiargs.cpp oaiaction.cpp oaidispatcher.cpp oaiconfig.cpp identityaction.cpp recordaction.cpp \
-                abstractlistaction.cpp listrecsaction.cpp listidsaction.cpp listsetsaction.cpp \
-                metaformatsaction.cpp oaitools.cpp metaformat.cpp dublincore.cpp rfc1807.cpp \
-                resumptiontoken.cpp
-
-OAISOURCES = 
-
-SOURCES = $(COMMONSOURCES) $(OAISOURCES)
-
-RECPTOBJECTS = ../../src/recpt/recptproto.o ../../src/recpt/recptprototools.o \
-	../../src/recpt/nullproto.o ../../src/recpt/htmlutils.o \
-	../../src/recpt/cgiargs.o ../../src/recpt/cgiutils.o
-
-COMMONOBJECTS = oaiargs.o oaiaction.o oaiconfig.o oaidispatcher.o \
-	identityaction.o recordaction.o abstractlistaction.o listrecsaction.o \
-	listidsaction.o listsetsaction.o metaformatsaction.o oaitools.o \
-	metaformat.o dublincore.o rfc1807.o resumptiontoken.o 
-
-OAIOBJECTS = oaimain.o
-
-OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(OAIOBJECTS)
-
-
-COLSERVROBJECTS = ../../src/colservr/comtypes.o \
-		  ../../src/colservr/mgq.o \
-		  ../../src/colservr/search.o \
-                  ../../src/colservr/mgsearch.o \
-                  ../../src/colservr/querycache.o \
-                  ../../src/colservr/queryinfo.o \
-                  ../../src/colservr/collectserver.o \
-                  ../../src/colservr/colservrconfig.o \
-                  ../../src/colservr/maptools.o \
-                  ../../src/colservr/filter.o \
-                  ../../src/colservr/source.o \
-                  ../../src/colservr/browsefilter.o \
-                  ../../src/colservr/queryfilter.o \
-                  ../../src/colservr/gdbmsource.o \
-                  ../../src/colservr/mggdbmsource.o \
-                  ../../src/colservr/phrasesearch.o \
-                  ../../src/colservr/phrasequeryfilter.o \
-		  ../../src/colservr/mgqueryfilter.o \
-		  ../../src/colservr/mgppsearch.o \
-		  ../../src/colservr/mgppqueryfilter.o \
-		  ../../src/colservr/collectset.o \
-		  ../../src/colservr/lucenesearch.o \
-		  ../../src/colservr/lucenequeryfilter.o \
-	          ../../src/colservr/lucenegdbmsource.o \
-	          ../../src/colservr/expat_resultset.o \
-		../../src/colservr/expat_document.o
+install: $(EXEC)
+	$(INSTALL) -m 755 -s $(EXEC) ../../cgi-bin
 
 distclean:
-	rm -f $(COMMONOBJECTS) $(OAIOBJECTS) $(EXEC) Makefile
+	rm -f $(OBJECTS) $(EXEC) Makefile
 
 clean:
-	rm -f $(COMMONOBJECTS) $(OAIOBJECTS) $(EXEC)
-
-install:
-	$(INSTALL) -m 755 -s $(EXEC) ../../cgi-bin
+	rm -f $(OBJECTS) $(EXEC)
 
 depend:
-	makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-OAI_OBJS = $(OBJECTS) $(COLSERVROBJECTS) \
-    ../../lib/gsdllib.a  \
-    $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
-    $(INDEXERS_DIR)/mg/lib/libmglib.a \
-    $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
-    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
-
-oaiserver$(EXEEXT): $(OAI_OBJS)
-	$(CXXLINK) -o $@ $(OAI_OBJS) $(LIBS) 
-
-
-
-
-
+	makedepend -Y -- $(DEFS) $(INCLUDES) $(CPPFLAGS) -- $(SOURCES)
