1 # Copyright (C) 1999-2006, Index Data ApS
3 # $Id: makefile,v 1.21 2008-02-21 10:16:26 adam Exp $
7 DEBUG=0 # 0 for release, 1 for debug
8 USE_MANIFEST = 0 # Can be enabled Visual Studio 2005
15 all: dirs generated dll myclient zclient yaz
17 NSIS="c:\program files\nsis\makensis-bz2.exe"
26 # The current directory is supposed to be something like
27 # ..../yaz/win, everything is relative to that
28 ROOTDIR=.. # The home of yazpp
30 INCLDIR=$(ROOTDIR)\include # our includes
31 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
32 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
33 WINDIR=$(ROOTDIR)\win # all these Win make things
34 SRCDIR=$(ROOTDIR)\src # for the case we move them under src
35 ZOOMDIR=$(ROOTDIR)\zoom
38 OBJDIR=$(WINDIR)\dobj # where we store intermediate files
40 OBJDIR=$(WINDIR)\obj # where we store intermediate files
43 TMPDIR=$(ROOTDIR)\win\tmp
46 # Targets - what to make
49 DLL=$(BINDIR)\yazpp3d.dll
50 YAZPP_IMPLIB=$(LIBDIR)\yazpp3d.lib
53 DLL=$(BINDIR)\yazpp3.dll
54 YAZPP_IMPLIB=$(LIBDIR)\yazpp3.lib
58 ZCLIENT=$(BINDIR)\zclient.exe
59 MY_CLIENT=$(BINDIR)\yaz-my-client.exe
61 # shortcut names defined here
64 myclient: $(MY_CLIENT)
66 # Compiler and linker options
69 YAZ_LIB="$(YAZ_DIR)\lib\$(YAZD).lib"
70 YAZ_DEF=/I"$(YAZ_DIR)\include"
71 yaz: $(BINDIR)\$(YAZD).dll
73 $(BINDIR)\$(YAZD).dll: "$(YAZ_DIR)\bin\$(YAZD).dll"
74 copy "$(YAZ_DIR)\bin\$(YAZD).dll" $(BINDIR)
77 /nologo /W3 /EHsc /FD /c \
78 /D "_CRT_SECURE_NO_DEPRECATE" \
88 /I"$(ROOTDIR)\include"
99 # /GX = Enable exception handling
100 # /FD = Generate file dependencies (what ever they are)
101 # /c = compile without linking
102 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
103 # /Fo = object file name (or at least path)
104 # /Fd = debug database name (or path)
105 # /MD = Runtime library: Multithread DLL
106 # /MDd = Runtime library: Multithread DLL (debug)
107 # /Od = Disable optimising (debug)
108 # /O2 = Optimize for speed
109 # /Gm = Minimal rebuild (some cpp class stuff)
110 # /Zi = Program database for debuggers
111 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
117 LINK_LIBS= kernel32.lib user32.lib gdi32.lib advapi32.lib uuid.lib \
118 wsock32.lib advapi32.lib \
121 COMMON_LNK_OPTIONS= /nologo /subsystem:windows /machine:i386 /incremental:no
123 DEBUG_LNK_OPTIONS= /debug
127 DLL_LINK_OPTIONS= /dll
128 CLIENT_LINK_OPTIONS = /subsystem:console
130 # Final opt variables
132 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
133 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
134 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
137 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
138 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
139 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
142 # Source and object modules
145 "$(OBJDIR)\gdu.obj" \
146 "$(OBJDIR)\gduqueue.obj" \
147 "$(OBJDIR)\pdu-observer.obj" \
148 "$(OBJDIR)\query.obj" \
149 "$(OBJDIR)\socket-observer.obj" \
150 "$(OBJDIR)\z-server.obj" \
151 "$(OBJDIR)\yaz-socket-manager.obj" \
152 "$(OBJDIR)\yaz-pdu-assoc.obj" \
153 "$(OBJDIR)\yaz-z-assoc.obj" \
154 "$(OBJDIR)\yaz-z-query.obj" \
155 "$(OBJDIR)\yaz-ir-assoc.obj" \
156 "$(OBJDIR)\yaz-z-server.obj" \
157 "$(OBJDIR)\yaz-pdu-assoc-thread.obj" \
158 "$(OBJDIR)\yaz-z-server-sr.obj" \
159 "$(OBJDIR)\yaz-z-server-ill.obj" \
160 "$(OBJDIR)\yaz-z-server-update.obj" \
161 "$(OBJDIR)\yaz-z-databases.obj" \
162 "$(OBJDIR)\yaz-z-cache.obj" \
163 "$(OBJDIR)\yaz-cql2rpn.obj" \
164 "$(OBJDIR)\zexcept.obj" \
165 "$(OBJDIR)\zconn.obj" \
166 "$(OBJDIR)\zquery.obj" \
167 "$(OBJDIR)\zrs.obj" \
171 "$(OBJDIR)\yaz-my-client.obj"
174 "$(OBJDIR)\zclient.obj"
176 # Note: This defines where to look for the necessary
177 # source files. Funny way of doing it, but it works.
179 {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
182 {$(ZOOMDIR)}.cpp{$(OBJDIR)}.obj:
185 ### The RC compiler (resource files)
187 COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
188 DEBUG_RC_OPTIONS=/d "_DEBUG"
189 RELEASE_RC_OPTIONS=/d "NDEBUG"
204 LINK_DLL = $(LINK) $(LNKOPT) $(LINK_LIBS) $(DLL_LINK_OPTIONS)
205 LINK_PROGRAM = $(LINK) $(LNKOPT) $(CLIENT_LINK_OPTIONS) $(LINK_LIBS) $(YAZPP_IMPLIB)
208 $(DLL) $(YAZPP_IMPLIB): "$(BINDIR)" $(DLL_OBJS)
209 $(LINK_DLL) $(DLL_OBJS) /out:$@ /implib:"$(YAZPP_IMPLIB)"
210 $(MT) -manifest $@.manifest -outputresource:$@;2
212 $(MY_CLIENT) : "$(BINDIR)" $(MY_CLIENT_OBJS) $(YAZPP_IMPLIB)
213 $(LINK_PROGRAM) $(MY_CLIENT_OBJS) /out:$@
214 $(MT) -manifest $@.manifest -outputresource:$@;1
216 $(ZCLIENT) : "$(BINDIR)" $(ZCLIENT_OBJS) $(YAZPP_IMPLIB)
217 $(LINK_PROGRAM) $(ZCLIENT_OBJS) /out:$@
218 $(MT) -manifest $@.manifest -outputresource:$@;1
220 generated: $(ZOOMDIR)\zoom.h
222 "$(ZOOMDIR)\zoom.h": "$(ZOOMDIR)\master-header"
223 sed "s/^* / /; s/^*/ /" "$(ZOOMDIR)\master-header" >"$(ZOOMDIR)\zoom.h"
233 -del $(ZOOMDIR)\zoom.h
235 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
237 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
238 if not exist "$@/$(NUL)" mkdir "$@"