1 # Copyright (C) 1998-2012 Index Data
6 DEBUG=0 # 0 for release, 1 for debug
7 USE_MANIFEST = 1 # Can be enabled Visual Studio 2005
14 all: dirs generated dll myclient zclient yaz
16 NSIS="c:\program files\nsis\makensis-bz2.exe"
25 # The current directory is supposed to be something like
26 # ..../yaz/win, everything is relative to that
27 ROOTDIR=.. # The home of yazpp
29 INCLDIR=$(ROOTDIR)\include # our includes
30 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
31 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
32 WINDIR=$(ROOTDIR)\win # all these Win make things
33 SRCDIR=$(ROOTDIR)\src # for the case we move them under src
34 ZOOMDIR=$(ROOTDIR)\zoom
37 OBJDIR=$(WINDIR)\dobj # where we store intermediate files
39 OBJDIR=$(WINDIR)\obj # where we store intermediate files
42 TMPDIR=$(ROOTDIR)\win\tmp
45 # Targets - what to make
48 DLL=$(BINDIR)\yazpp5d.dll
49 YAZPP_IMPLIB=$(LIBDIR)\yazpp5d.lib
52 DLL=$(BINDIR)\yazpp5.dll
53 YAZPP_IMPLIB=$(LIBDIR)\yazpp5.lib
57 ZCLIENT=$(BINDIR)\zclient.exe
58 MY_CLIENT=$(BINDIR)\yaz-my-client.exe
60 # shortcut names defined here
63 myclient: $(MY_CLIENT)
65 # Compiler and linker options
68 YAZ_LIB="$(YAZ_DIR)\lib\$(YAZD).lib"
69 YAZ_DEF=/I"$(YAZ_DIR)\include"
70 yaz: $(BINDIR)\$(YAZD).dll
72 $(BINDIR)\$(YAZD).dll: "$(YAZ_DIR)\bin\$(YAZD).dll"
73 copy "$(YAZ_DIR)\bin\$(YAZD).dll" $(BINDIR)
76 /nologo /W3 /EHsc /FD /c \
77 /D "_CRT_SECURE_NO_DEPRECATE" \
87 /I"$(ROOTDIR)\include"
98 # /GX = Enable exception handling
99 # /FD = Generate file dependencies (what ever they are)
100 # /c = compile without linking
101 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
102 # /Fo = object file name (or at least path)
103 # /Fd = debug database name (or path)
104 # /MD = Runtime library: Multithread DLL
105 # /MDd = Runtime library: Multithread DLL (debug)
106 # /Od = Disable optimising (debug)
107 # /O2 = Optimize for speed
108 # /Gm = Minimal rebuild (some cpp class stuff)
109 # /Zi = Program database for debuggers
110 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
116 LINK_LIBS= kernel32.lib advapi32.lib $(YAZ_LIB)
118 COMMON_LNK_OPTIONS= /nologo /subsystem:windows /incremental:no
120 DEBUG_LNK_OPTIONS= /debug
124 DLL_LINK_OPTIONS= /dll
125 CLIENT_LINK_OPTIONS = /subsystem:console
127 # Final opt variables
129 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
130 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
131 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
134 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
135 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
136 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
139 # Source and object modules
142 "$(OBJDIR)\timestat.obj" \
143 "$(OBJDIR)\gdu.obj" \
144 "$(OBJDIR)\gduqueue.obj" \
145 "$(OBJDIR)\limit-connect.obj" \
146 "$(OBJDIR)\pdu-observer.obj" \
147 "$(OBJDIR)\query.obj" \
148 "$(OBJDIR)\socket-observer.obj" \
149 "$(OBJDIR)\z-server.obj" \
150 "$(OBJDIR)\yaz-socket-manager.obj" \
151 "$(OBJDIR)\yaz-pdu-assoc.obj" \
152 "$(OBJDIR)\yaz-z-assoc.obj" \
153 "$(OBJDIR)\yaz-z-query.obj" \
154 "$(OBJDIR)\yaz-ir-assoc.obj" \
155 "$(OBJDIR)\yaz-z-server.obj" \
156 "$(OBJDIR)\yaz-pdu-assoc-thread.obj" \
157 "$(OBJDIR)\yaz-z-server-sr.obj" \
158 "$(OBJDIR)\yaz-z-server-ill.obj" \
159 "$(OBJDIR)\yaz-z-server-update.obj" \
160 "$(OBJDIR)\yaz-z-databases.obj" \
161 "$(OBJDIR)\yaz-z-cache.obj" \
162 "$(OBJDIR)\yaz-cql2rpn.obj" \
163 "$(OBJDIR)\zexcept.obj" \
164 "$(OBJDIR)\zconn.obj" \
165 "$(OBJDIR)\zquery.obj" \
166 "$(OBJDIR)\zrs.obj" \
170 "$(OBJDIR)\yaz-my-client.obj"
173 "$(OBJDIR)\zclient.obj"
175 # Note: This defines where to look for the necessary
176 # source files. Funny way of doing it, but it works.
178 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
181 {$(ZOOMDIR)}.cpp{$(OBJDIR)}.obj:
184 ### The RC compiler (resource files)
186 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
187 DEBUG_RC_OPTIONS=/d "_DEBUG"
188 RELEASE_RC_OPTIONS=/d "NDEBUG"
203 LINK_DLL = $(LINK) $(LNKOPT) $(LINK_LIBS) $(DLL_LINK_OPTIONS)
204 LINK_PROGRAM = $(LINK) $(LNKOPT) $(CLIENT_LINK_OPTIONS) $(LINK_LIBS) $(YAZPP_IMPLIB)
207 $(DLL) $(YAZPP_IMPLIB): "$(BINDIR)" $(DLL_OBJS)
208 $(LINK_DLL) $(DLL_OBJS) /out:$@ /implib:"$(YAZPP_IMPLIB)"
209 $(MT) -manifest $@.manifest -outputresource:$@;2
211 $(MY_CLIENT) : "$(BINDIR)" $(MY_CLIENT_OBJS) $(YAZPP_IMPLIB)
212 $(LINK_PROGRAM) $(MY_CLIENT_OBJS) /out:$@
213 $(MT) -manifest $@.manifest -outputresource:$@;1
215 $(ZCLIENT) : "$(BINDIR)" $(ZCLIENT_OBJS) $(YAZPP_IMPLIB)
216 $(LINK_PROGRAM) $(ZCLIENT_OBJS) /out:$@
217 $(MT) -manifest $@.manifest -outputresource:$@;1
219 generated: $(ZOOMDIR)\zoom.h
221 "$(ZOOMDIR)\zoom.h": "$(ZOOMDIR)\master-header"
222 sed "s/^* / /; s/^*/ /" "$(ZOOMDIR)\master-header" >"$(ZOOMDIR)\zoom.h"
232 -del $(ZOOMDIR)\zoom.h
234 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
236 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
237 if not exist "$@/$(NUL)" mkdir "$@"