Index: gsdl/trunk/src/w32server/win32.mak
===================================================================
--- gsdl/trunk/src/w32server/win32.mak	(revision 15532)
+++ gsdl/trunk/src/w32server/win32.mak	(revision 15541)
@@ -25,12 +25,15 @@
 ###########################################################################
 
-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
-STLPATH = "$(GSDLHOME)\packages\windows\stlport\stlport"
+STLPATH = "$(GSDL_DIR)\packages\windows\stlport\stlport"
 ENABLE_ACCENTFOLD = 1
 
-AR = lib
-CC = cl
-RSC = rc
 
 !IF $(GSDL_VC4)
@@ -40,13 +43,30 @@
 !ENDIF
 
+!IF $(ENABLE_ACCENTFOLD)
+ACCENTFOLD_LIBS = "$(GSDL_DIR)\indexers\packages\unac\libunac.lib" "$(GSDL_DIR)\indexers\packages\unac\iconv.lib"
+!ELSE
+ACCENTFOLD_LIBS = 
+!ENDIF
+
+
+AR = lib
+CC = cl
+DEFS = -D__WIN32__ -DHAVE_CONFIG_H -D_LITTLE_ENDIAN -DPARADOCNUM \
+       -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE
+INCLUDES = -I"$(GSDL_DIR)" -I"$(GSDL_DIR)\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" -I"$(RECPT_DIR)" \
+	   -I"$(GSDL_DIR)\src\colservr" -I"$(GSDL_DIR)\indexers\mg" \
+	   -I"$(GSDL_DIR)\packages\windows\gdbm\gdbm" \
+           -I"$(GSDL_DIR)\indexers\mg\lib" -I"$(GSDL_DIR)\indexers\mg\src\text" \
+    	   -I"$(GSDL_DIR)\indexers\mgpp\lib" -I"$(GSDL_DIR)\indexers\mgpp\text"
 LDFLAGS =
-DEFS = -DHAVE_CONFIG_H -D_LITTLE_ENDIAN -DPARADOCNUM -D__WIN32__ \
-       -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE
-INCLUDES = -I"$(GSDLHOME)\src\w32server" -I"$(GSDLHOME)\src\recpt" -I"$(GSDLHOME)\lib" \
-	   -I"$(GSDLHOME)\src\colservr" -I"$(GSDLHOME)\indexers\mg" \
-	   -I"$(GSDLHOME)\packages\windows\gdbm\gdbm" \
-           -I"$(GSDLHOME)\indexers\mg\lib" -I"$(GSDLHOME)\indexers\mg\src\text" \
-    	   -I"$(GSDLHOME)\indexers\mgpp\lib" -I"$(GSDLHOME)\indexers\mgpp\text" -I"$(GSDLHOME)" \
-           -I"$(GSDLHOME)\src\protocol"
+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) $(Z3950_LIBS)
+RSC = rc
+WINLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib \
+          comdlg32.lib advapi32.lib shell32.lib ole32.lib \
+          oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 
+#wsock32.lib
+
+
 !IF $(GSDL_VC4)
 DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
@@ -54,86 +74,92 @@
 !ENDIF
 
-!IF $(ENABLE_ACCENTFOLD)
-AFLIBS = "$(GSDLHOME)\indexers\packages\unac\libunac.lib" "$(GSDLHOME)\indexers\packages\unac\iconv.lib"
-DEFS = $(DEFS) -DENABLE_ACCENTFOLD
-!ELSE
-AFLIBS = 
-!ENDIF
-
-LIBS = "$(GSDLHOME)\lib\gsdllib.lib" \
-       "$(GSDLHOME)\indexers\mg\src\text\libmgtext.lib" \
-       "$(GSDLHOME)\indexers\mg\lib\libmglib.lib" \
-       "$(GSDLHOME)\src\colservr\gsdlcolservr.lib" \
-       "$(GSDLHOME)\src\recpt\gsdlrecpt.lib" \
-       "$(GSDLHOME)\packages\windows\gdbm\gdbm\gdbm.lib" \
-       "$(GSDLHOME)\packages\windows\crypt\crypt\crypt.lib" \
-       "$(GSDLHOME)\indexers\mgpp\lib\libmgpplib.lib" \
-       "$(GSDLHOME)\indexers\mgpp\text\libmgpptext.lib" \
-       "$(GSDLHOME)\packages\windows\expat\expat\libexpat.lib" \
-       "$(GSDLHOME)\src\protocol\gsdlprotocol.lib" \
-	$(AFLIBS)
-
-
-WINLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib \
-          comdlg32.lib advapi32.lib shell32.lib ole32.lib \
-          oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 
-#wsock32.lib
 
 COMPILE = $(CC) -nologo -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
 LINK = $(CC) -nologo $(LDFLAGS) -Fe"$@"
 
+
 .SUFFIXES:
-.SUFFIXES: .c .obj
-.c.obj:
-	$(COMPILE) $<
-
 .SUFFIXES: .cpp .obj
 .cpp.obj:
 	$(COMPILE) $< 
 
-HEADERS = cgiwrapper.h conftools.h d_winsock.h fnord.h httpreq.h httpsend.h \
-          httpsrv.h locate.h netio.h parse.h settings.h startbrowser.h \
-	  wincgiutils.h
 
-SOURCES = cgiwrapper.cpp conftools.cpp d_winsock.cpp fnord.cpp httpreq.cpp httpsend.cpp \
-          httpsrv.cpp locate.cpp netio.cpp parse.cpp settings.cpp startbrowser.cpp \
-	  wincgiutils.cpp
+SOURCES = \
+	cgiwrapper.cpp \
+	conftools.cpp \
+	d_winsock.cpp \
+	fnord.cpp \
+	httpreq.cpp \
+	httpsend.cpp \
+        httpsrv.cpp \
+	locate.cpp \
+	netio.cpp \
+	parse.cpp \
+	settings.cpp \
+	startbrowser.cpp \
+	wincgiutils.cpp
 
-OBJECTS = cgiwrapper.obj conftools.obj d_winsock.obj fnord.obj httpreq.obj httpsend.obj \
-          httpsrv.obj locate.obj netio.obj parse.obj settings.obj startbrowser.obj \
-	  wincgiutils.obj server.res
+OBJECTS = \
+	cgiwrapper.obj \
+	conftools.obj \
+	d_winsock.obj \
+	fnord.obj \
+	httpreq.obj \
+	httpsend.obj \
+        httpsrv.obj \
+	locate.obj \
+	netio.obj \
+	parse.obj \
+	settings.obj \
+	startbrowser.obj \
+	wincgiutils.obj
 
-EXEC = server.exe
+GSDL_LIBS = \
+	"$(RECPT_DIR)\gsdlrecpt.lib" \
+	"$(PROTOCOL_DIR)\gsdlprotocol.lib" \
+	"$(COLSERVR_DIR)\gsdlcolservr.lib" \
+	"$(GSDL_DIR)\lib\gsdllib.lib" \
+	"$(INDEXERS_DIR)\mg\src\text\libmgtext.lib" \
+	"$(INDEXERS_DIR)\mg\lib\libmglib.lib" \
+	"$(INDEXERS_DIR)\mgpp\text\libmgpptext.lib" \
+	"$(INDEXERS_DIR)\mgpp\lib\libmgpplib.lib"
 
-all: $(EXEC)
+EXECUTABLE_OBJECTS = \
+	$(OBJECTS) \
+	$(GSDL_LIBS)
+
+EXECUTABLE = server.exe
+
+
+server.exe: $(EXECUTABLE_OBJECTS)
+	$(LINK) $(EXECUTABLE_OBJECTS) $(LIBS) $(WINLIBS) 
+
+all: $(EXECUTABLE)
+
+install:
+	copy $(EXECUTABLE) "$(GSDL_DIR)"
 
 clean:
 	del *.obj
-	del $(EXEC)
-
-install:
-	copy $(EXEC) "$(GSDLHOME)"
-
-server.exe: $(OBJECTS) $(LIBS)
-	    $(LINK) $(OBJECTS) $(LIBS) $(WINLIBS) 
+	del $(EXECUTABLE)
 
 
-SOURCE = "$(GSDLHOME)\src\w32server\newgsdl.bmp"
-SOURCE = "$(GSDLHOME)\src\w32server\resource.h"
-SOURCE = "$(GSDLHOME)\src\w32server\server.ico"
-SOURCE = "$(GSDLHOME)\src\w32server\gsdlcol.bmp"
-SOURCE = "$(GSDLHOME)\src\w32server\server.rc"
+SOURCE = "$(GSDL_DIR)\src\w32server\newgsdl.bmp"
+SOURCE = "$(GSDL_DIR)\src\w32server\resource.h"
+SOURCE = "$(GSDL_DIR)\src\w32server\server.ico"
+SOURCE = "$(GSDL_DIR)\src\w32server\gsdlcol.bmp"
+SOURCE = "$(GSDL_DIR)\src\w32server\server.rc"
 DEP_RSC_SERVE=\
-	"$(GSDLHOME)\src\w32server\gsdlcol.bmp"\
-	"$(GSDLHOME)\src\w32server\newgsdl.bmp"\
-	"$(GSDLHOME)\src\w32server\server.ico"
+	"$(GSDL_DIR)\src\w32server\gsdlcol.bmp"\
+	"$(GSDL_DIR)\src\w32server\newgsdl.bmp"\
+	"$(GSDL_DIR)\src\w32server\server.ico"
 
-server.res : $(SOURCE) $(DEP_RSC_SERVE) "$(GSDLHOME)\src\w32server"
-   $(RSC) /l 0x409 /fo"$(GSDLHOME)\src\w32server\server.res" /i "$(GSDLHOME)\src\w32server" \
+server.res : $(SOURCE) $(DEP_RSC_SERVE) "$(GSDL_DIR)\src\w32server"
+   $(RSC) /l 0x409 /fo"$(GSDL_DIR)\src\w32server\server.res" /i "$(GSDL_DIR)\src\w32server" \
  /d "NDEBUG" $(SOURCE)
 
 
-"$(GSDLHOME)\src\w32server\server.res" : $(SOURCE) $(DEP_RSC_SERVE) "$(GSDLHOME)\src\w32server"
-   $(RSC) /l 0x409 /fo"$(GSDLHOME)\src\w32server\server.res" /i "$(GSDLHOME)\src\w32server" \
+"$(GSDL_DIR)\src\w32server\server.res" : $(SOURCE) $(DEP_RSC_SERVE) "$(GSDL_DIR)\src\w32server"
+   $(RSC) /l 0x409 /fo"$(GSDL_DIR)\src\w32server\server.res" /i "$(GSDL_DIR)\src\w32server" \
  /d "NDEBUG" $(SOURCE)
 
