Index: trunk/gsdl/src/recpt/win32.mak
===================================================================
--- trunk/gsdl/src/recpt/win32.mak	(revision 2329)
+++ trunk/gsdl/src/recpt/win32.mak	(revision 2338)
@@ -25,6 +25,8 @@
 ###########################################################################
 
-GSDLHOME = c:\gsdl
-STLPATH = c:\stlport
+GSDLHOME = ..\..
+USE_STLPORT = 0
+LOCAL_LIBRARY = 0
+STLPATH = "$(GSDLHOME)\packages\windows\stlport\stlport"
 
 AR = lib
@@ -32,13 +34,24 @@
 CPPFLAGS =
 LDFLAGS =
-DEFS = -DNZDL -DQUIET -D__WIN32__ -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H \
-       -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H -D__STL_NO_NEW_IOSTREAMS \
-       -DGSDLSERVER -DGSDLUSAGELOG	
-INCLUDES = -I$(GSDLHOME)\src\recpt -I$(GSDLHOME)\lib -I$(GSDLHOME)\src\colservr \
-	   -I$(GSDLHOME)\packages\mg -I$(GSDLHOME)\packages\mg\lib \
-	   -I$(GSDLHOME)\packages\mg\src\text -I$(GSDLHOME)\packages\wingdbm \
-	   -I$(STLPATH) -I$(GSDLHOME)\packages\wincrypt
+DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX
+INCLUDES = -I"$(GSDLHOME)\src\recpt" -I"$(GSDLHOME)\lib" -I"$(GSDLHOME)\src\colservr" \
+	   -I"$(GSDLHOME)\packages\mg" -I"$(GSDLHOME)\packages\mg\lib" \
+	   -I"$(GSDLHOME)\packages\mg\src\text" -I"$(GSDLHOME)\packages\windows\gdbm\gdbm" \
+	   -I"$(GSDLHOME)\packages\windows\crypt\crypt"
+!IF $(USE_STLPORT)
+DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
+INCLUDES = $(INCLUDES) -I$(STLPATH)
+!ENDIF
+!IF $(LOCAL_LIBRARY)
+DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
+!ENDIF
 
-LIBS = $(GSDLHOME)\packages\wingdbm\gdbm.lib $(GSDLHOME)\packages\wincrypt\crypt.lib
+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)\packages\mg\src\text\libtextin.lib" \
+       "$(GSDLHOME)\packages\mg\lib\libmg.lib"
+
 
 COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
@@ -55,101 +68,77 @@
 
 
-COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
+COMMONHEADERS = receptionist.h cgiargs.h action.h browserclass.h \
                 converter.h recptconfig.h cgiutils.h OIDtools.h browsetools.h htmlgen.h \
-		statusaction.h pageaction.h comtypes.h recptproto.h \
-		pingaction.h queryaction.h documentaction.h \
-		extlinkaction.h buildaction.h htmlutils.h \
+		statusaction.h pageaction.h comtypes.h recptproto.h pingaction.h \
+		queryaction.h documentaction.h extlinkaction.h htmlutils.h \
 		querytools.h formattools.h tipaction.h authenaction.h infodbclass.h \
                 userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
 		datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \
-		htmlbrowserclass.h delhistoryaction.h historydb.h
+		htmlbrowserclass.h historydb.h phindbrowserclass.h collectoraction.h \
+		nullprtoto.h
 
-RECEPTHEADERS = 
+CGIHEADERS = cgiwrapper.h
 
-LIBRARYHEADERS = nullproto.h
-
-HEADERS = $(COMMONHEADERS) $(RECPTHEADERS) $(LIBRARYHEADERS)
+HEADERS = $(COMMONHEADERS) $(CGIHEADERS)
 
 
-COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
+COMMONSOURCES = receptionist.cpp cgiargs.cpp action.cpp browserclass.cpp \
                 converter.cpp recptconfig.cpp cgiutils.cpp OIDtools.cpp browsetools.cpp \
 		htmlgen.cpp statusaction.cpp pageaction.cpp comtypes.cpp \
 		recptproto.cpp pingaction.cpp queryaction.cpp documentaction.cpp \
-		extlinkaction.cpp buildaction.cpp htmlutils.cpp querytools.cpp formattools.cpp \
+		extlinkaction.cpp htmlutils.cpp querytools.cpp formattools.cpp \
 		tipaction.cpp authenaction.cpp infodbclass.cpp userdb.cpp usersaction.cpp \
 		vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
 		invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \
-		delhistoryaction.cpp historydb.cpp
+		historydb.cpp phindbrowserclass.cpp collectoraction.cpp nullproto.cpp
+
+CGISOURCES = librarymain.cpp cgiwrapper.cpp
+
+SOURCES = $(COMMONSOURCES) $(CGISOURCES)
 
 
-RECPTSOURCES = recptmain.cpp
+COMMONOBJECTS = receptionist.obj cgiargs.obj action.obj browserclass.obj \
+                converter.obj recptconfig.obj cgiutils.obj OIDtools.obj browsetools.obj \
+		htmlgen.obj statusaction.obj pageaction.obj comtypes.obj recptproto.obj \
+		pingaction.obj queryaction.obj documentaction.obj extlinkaction.obj \
+		htmlutils.obj querytools.obj formattools.obj tipaction.obj \
+		authenaction.obj infodbclass.obj userdb.obj usersaction.obj \
+		vlistbrowserclass.obj hlistbrowserclass.obj datelistbrowserclass.obj \
+		invbrowserclass.obj pagedbrowserclass.obj htmlbrowserclass.obj \
+		historydb.obj phindbrowserclass.obj collectoraction.obj nullproto.obj
 
-LIBRARYSOURCES = nullproto.cpp librarymain.cpp
+CGIOBJECTS = librarymain.obj cgiwrapper.obj
 
-SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
+OBJECTS = $(COMMONOBJECTS) $(CGIOBJECTS)
 
+EXEC = library.exe
 
-COMMONOBJECTS = receptionist.obj cgiwrapper.obj cgiargs.obj action.obj browserclass.obj \
-                converter.obj recptconfig.obj cgiutils.obj OIDtools.obj browsetools.obj \
-		htmlgen.obj statusaction.obj pageaction.obj comtypes.obj \
-		recptproto.obj pingaction.obj queryaction.obj documentaction.obj \
-		extlinkaction.obj buildaction.obj htmlutils.obj querytools.obj \
-		formattools.obj tipaction.obj authenaction.obj \
-                infodbclass.obj userdb.obj usersaction.obj vlistbrowserclass.obj \
-		hlistbrowserclass.obj datelistbrowserclass.obj invbrowserclass.obj \
-		pagedbrowserclass.obj htmlbrowserclass.obj delhistoryaction.obj \
-		historydb.obj
+!IF $(LOCAL_LIBRARY)
+all: gsdlrecpt.lib
+!ELSE
+all: $(EXEC)
+!ENDIF
 
-RECPTOBJECTS = recptmain.obj
-
-LIBRARYOBJECTS = nullproto.obj librarymain.obj
-
-OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
-
-
-COLSERVROBJECTS = $(GSDLHOME)\src\colservr\mgq.obj \
-                  $(GSDLHOME)\src\colservr\mgsearch.obj \
-                  $(GSDLHOME)\src\colservr\querycache.obj \
-                  $(GSDLHOME)\src\colservr\queryinfo.obj \
-                  $(GSDLHOME)\src\colservr\collectserver.obj \
-                  $(GSDLHOME)\src\colservr\colservrconfig.obj \
-                  $(GSDLHOME)\src\colservr\maptools.obj \
-                  $(GSDLHOME)\src\colservr\filter.obj \
-                  $(GSDLHOME)\src\colservr\source.obj \
-                  $(GSDLHOME)\src\colservr\browsefilter.obj \
-                  $(GSDLHOME)\src\colservr\queryfilter.obj \
-                  $(GSDLHOME)\src\colservr\mggdbmsource.obj \
-                  $(GSDLHOME)\src\colservr\phrasesearch.obj \
-                  $(GSDLHOME)\src\colservr\phrasequeryfilter.obj
-
-EXEC = recpt.exe library.exe
-
-all: $(EXEC)
+gsdlrecpt.lib : $(COMMONOBJECTS)
+	if EXIST gsdlrecpt.lib del gsdlrecpt.lib
+	$(AR) /out:gsdlrecpt.lib $(COMMONOBJECTS)
 
 clean:
 	del *.obj
-	del recpt.exe
 	del library.exe
 
+!IF $(LOCAL_LIBRARY)
 install:
-	copy library.exe $(GSDLHOME)\cgi-bin\library.exe
+!ELSE
+install:
+	copy library.exe "$(GSDLHOME)\cgi-bin"
+!ENDIF
 
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+library.exe: $(OBJECTS)
+	     $(LINK) $(OBJECTS) $(LIBS) 
 
-RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
-    $(GSDLHOME)\lib\gsdllib.lib  \
-    $(GSDLHOME)\packages\mg\src\text\libtextin.lib \
-    $(GSDLHOME)\packages\mg\lib\libmg.lib
+# we want statusaction to always be compiled in case the status of
+# GSDL_LOCAL_LIBRARY has changed
+statusaction.obj: FORCE
 
-recpt.exe: $(RECPT_OBJS)
-           $(LINK) $(RECPT_OBJS) $(LIBS) 
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
-    $(GSDLHOME)\lib\gsdllib.lib \
-    $(GSDLHOME)\packages\mg\src\text\libtextin.lib \
-    $(GSDLHOME)\packages\mg\lib\libmg.lib
-
-library.exe: $(LIBRARY_OBJS)
-	     $(LINK) $(LIBRARY_OBJS) $(LIBS) 
+FORCE:
