Index: /gsdl/trunk/src/oaiservr/win32.mak
===================================================================
--- /gsdl/trunk/src/oaiservr/win32.mak	(revision 15530)
+++ /gsdl/trunk/src/oaiservr/win32.mak	(revision 15531)
@@ -1,10 +1,10 @@
 ###########################################################################
 #
-# win32 makefile -- src/oaiservr
+# win32 makefile -- src/oaiserver
 # A component of the Greenstone digital library software
 # from the New Zealand Digital Library Project at the
 # University of Waikato, New Zealand.
 #
-# Copyright (C) 1999  The New Zealand Digital Library Project
+# Copyright (C) 1999-2008  The New Zealand Digital Library Project
 #
 #
@@ -25,18 +25,19 @@
 ###########################################################################
 
-GSDLHOME = ..\..
+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
+
+
 GSDL_VC4 = 0
+LOCAL_LIBRARY = 0
 DLL = 0
 DLLDEBUG = 0
 ENABLE_ACCENTFOLD = 1
 
-STLPATH = "$(GSDLHOME)\packages\windows\stlport\stlport"
+STLPATH = "$(GSDL_DIR)\packages\windows\stlport\stlport"
 
-recptDir = $(GSDLHOME)\src\recpt
-colservrDir = $(GSDLHOME)\src\colservr
-srcDir = $(GSDLHOME)\src
-
-AR = lib
-CC = cl
 
 !IF $(GSDL_VC4)
@@ -54,43 +55,35 @@
 !ENDIF
 
-LDFLAGS =
-DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE
-INCLUDES = -I"$(GSDLHOME)\src\recpt" -I"$(GSDLHOME)\lib" -I"$(GSDLHOME)\src\colservr" \
-	   -I"$(GSDLHOME)\indexers\mg" -I"$(GSDLHOME)\indexers\mg\lib" \
-	   -I"$(GSDLHOME)\indexers\mg\src\text" -I"$(GSDLHOME)\packages\windows\gdbm\gdbm" \
-	   -I"$(GSDLHOME)\packages\windows\crypt\crypt" -I"$(GSDLHOME)\indexers\mgpp\lib" \
-	   -I"$(GSDLHOME)\indexers\mgpp\text" -I"$(GSDLHOME)"
+!IF $(ENABLE_ACCENTFOLD)
+ACCENTFOLD_LIBS = "$(INDEXERS_DIR)\packages\unac\libunac.lib" "$(INDEXERS_DIR)\packages\unac\iconv.lib"
+!ELSE
+ACCENTFOLD_LIBS = 
+!ENDIF
+
+
+AR = lib
+CC = cl
+DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE -DGSDL_NOCACHE
+INCLUDES = -I"$(GSDL_DIR)\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" -I"$(RECPT_DIR)" \
+        -I"$(INDEXERS_DIR)\mgpp\text" -I"$(GSDL_DIR)\packages\windows\crypt\crypt" \
+	-I"$(GSDL_DIR)\packages\windows\expat\expat" -I"$(GSDL_DIR)\packages\windows\gdbm\gdbm"
+LDFLAGS = 
+LIBS = "$(GSDL_DIR)\packages\windows\crypt\crypt\crypt.lib" "$(GSDL_DIR)\packages\windows\expat\expat\libexpat.lib" \
+        "$(GSDL_DIR)\packages\windows\gdbm\gdbm\gdbm.lib" $(ACCENTFOLD_LIBS)
+
 !IF $(GSDL_VC4)
 DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
 INCLUDES = $(INCLUDES) -I$(STLPATH)
 !ENDIF
-
-!IF $(ENABLE_ACCENTFOLD)
-AFLIBS = "$(GSDLHOME)\indexers\packages\unac\libunac.lib" "$(GSDLHOME)\indexers\packages\unac\iconv.lib"
-DEFS = $(DEFS) -DENABLE_ACCENTFOLD
-!ELSE
-AFLIBS = 
+!IF $(LOCAL_LIBRARY)
+DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
 !ENDIF
-
-LIBS = "$(GSDLHOME)\packages\windows\gdbm\gdbm\gdbm.lib" \
-       "$(GSDLHOME)\packages\windows\crypt\crypt\crypt.lib" \
-       "$(GSDLHOME)\src\colservr\gsdlcolservr.lib" \
-       "$(GSDLHOME)\lib\gsdllib.lib" \
-       "$(GSDLHOME)\indexers\mg\src\text\libmgtext.lib" \
-       "$(GSDLHOME)\indexers\mg\lib\libmglib.lib" \
-       "$(GSDLHOME)\indexers\mgpp\text\libmgpptext.lib" \
-       "$(GSDLHOME)\indexers\mgpp\lib\libmgpplib.lib" \
-       "$(GSDLHOME)\packages\windows\expat\expat\libexpat.lib" \
-	$(AFLIBS)
 
 
 COMPILE = $(CC) -nologo -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
-LINK = $(CC) -nologo $(LDFLAGS) -Fe"$@"
+LINK = $(CC) -nologo -Fe"$@" 
+
 
 .SUFFIXES:
-.SUFFIXES: .c .obj
-.c.obj:
-	$(COMPILE) $<
-
 .SUFFIXES: .cpp .obj
 .cpp.obj:
@@ -98,45 +91,74 @@
 
 
-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
+RECPT_OBJECTS = \
+	$(RECPT_DIR)\cgiargs.obj \
+	$(RECPT_DIR)\cgiutils.obj \
+	$(RECPT_DIR)\htmlutils.obj \
+	$(RECPT_DIR)\recptprototools.obj
 
-HEADERS = $(COMMONHEADERS)
+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.obj \
+	dublincore.obj \
+	identityaction.obj \
+	listidsaction.obj \
+	listrecsaction.obj \
+	listsetsaction.obj \
+	metaformat.obj \
+	metaformatsaction.obj \
+	oaiaction.obj \
+	oaiargs.obj \
+	oaiconfig.obj \
+	oaidispatcher.obj \
+	oaimain.obj \
+	oaitools.obj \
+	recordaction.obj \
+	resumptiontoken.obj \
+	rfc1807.obj
+
+GSDL_LIBS = \
+	$(PROTOCOL_DIR)\gsdlprotocol.lib \
+	$(COLSERVR_DIR)\gsdlcolservr.lib \
+	"$(GSDL_DIR)\lib\gsdllib.lib" \
+	"$(GSDL_DIR)\indexers\mg\src\text\libmgtext.lib" \
+	"$(GSDL_DIR)\indexers\mg\lib\libmglib.lib" \
+	"$(GSDL_DIR)\indexers\mgpp\text\libmgpptext.lib" \
+	"$(GSDL_DIR)\indexers\mgpp\lib\libmgpplib.lib"
+
+EXECUTABLE_OBJECTS = \
+	$(OBJECTS) \
+	$(RECPT_OBJECTS) \
+	$(GSDL_LIBS)
+
+EXECUTABLE = oaiserver.exe
 
 
-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
+oaiserver.exe: $(EXECUTABLE_OBJECTS)
+	$(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
 
-OAISOURCES = 
+all: $(EXECUTABLE)
 
-SOURCES = $(COMMONSOURCES) $(OAISOURCES)
-
-RECPTOBJECTS = "$(recptDir)\recptproto.obj" "$(recptDir)\recptprototools.obj" \
-               "$(recptDir)\nullproto.obj" "$(recptDir)\htmlutils.obj" \
-	       "$(recptDir)\cgiargs.obj" "$(recptDir)\cgiutils.obj"
-
-COMMONOBJECTS = oaiargs.obj oaiaction.obj oaiconfig.obj oaidispatcher.obj identityaction.obj recordaction.obj \
-                abstractlistaction.obj listrecsaction.obj listidsaction.obj listsetsaction.obj \
-                metaformatsaction.obj oaitools.obj \
-                metaformat.obj dublincore.obj rfc1807.obj resumptiontoken.obj $(RECPTOBJECTS)
-
-OAIOBJECTS = oaimain.obj
-
-OBJECTS = $(COMMONOBJECTS) $(OAIOBJECTS)
-
-OAI_OBJS = $(COMMONOBJECTS) $(OAIOBJECTS) $(LIBS)
-
-EXEC = oaiserver.exe
-
-all: $(EXEC)
+install: $(EXECUTABLE)
+	copy oaiserver.exe "$(GSDL_DIR)\cgi-bin"
 
 clean:
 	del *.obj
 	del oaiserver.exe
-install:
-	copy oaiserver.exe "$(GSDLHOME)\cgi-bin"
-
-oaiserver.exe: $(OAI_OBJS)
-	     $(LINK) $(OAI_OBJS)
